{"record":{"id":"70e0733b715ad470","repo":"alibaba/arthas","slug":"current-os-do-not-support-asyncprofiler-only-supp","errorCode":null,"errorMessage":"Current OS do not support AsyncProfiler, Only support Linux/Mac.","messagePattern":"Current OS do not support AsyncProfiler, Only support Linux/Mac\\.","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java","lineNumber":585,"sourceCode":"                File tmpLibFile = File.createTempFile(VmTool.JNI_LIBRARY_NAME, null);\n                tmpLibOutputStream = new FileOutputStream(tmpLibFile);\n                libInputStream = new FileInputStream(libPath);\n\n                IOUtils.copy(libInputStream, tmpLibOutputStream);\n                libPath = tmpLibFile.getAbsolutePath();\n                logger.debug(\"copy {} to {}\", libPath, tmpLibFile);\n            } catch (Throwable e) {\n                logger.error(\"try to copy lib error! libPath: {}\", libPath, e);\n            } finally {\n                IOUtils.close(libInputStream);\n                IOUtils.close(tmpLibOutputStream);\n            }\n            profiler = AsyncProfiler.getInstance(libPath);\n        } else {\n            if (OSUtils.isLinux() || OSUtils.isMac()) {\n                throw new IllegalStateException(\"Can not find libasyncProfiler so, please check the arthas directory.\");\n            } else {\n                throw new IllegalStateException(\"Current OS do not support AsyncProfiler, Only support Linux/Mac.\");\n            }\n        }\n\n        return profiler;\n    }\n\n    /**\n     * https://github.com/async-profiler/async-profiler/blob/v4.4/src/arguments.cpp\n     */\n    public enum ProfilerAction {\n        // start, resume, stop, dump, status, meminfo, list,\n        start, resume, stop, dump, status, meminfo, list,\n        version,\n\n        load,\n        execute,\n        dumpCollapsed, dumpFlat, dumpTraces, getSamples,\n        actions","sourceCodeStart":567,"sourceCodeEnd":603,"githubUrl":"https://github.com/alibaba/arthas/blob/21cf2e9ba52b305290be7223b980ff504bb9cb5b/core/src/main/java/com/taobao/arthas/core/command/monitor200/ProfilerCommand.java#L567-L603","documentation":"Thrown by profilerInstance() in the `profiler` command when the operating system is neither Linux nor macOS and no explicit libPath/load action is provided. async-profiler only ships native libraries for Linux and Mac, so Windows (and other OSes) are explicitly unsupported.","triggerScenarios":"Running `profiler start` on Windows or any non-Linux/non-Mac OS without providing a libPath via `profiler load`.","commonSituations":"Trying to use the profiler from a Windows development machine; running arthas inside WSL but the JVM reports the host OS oddly; using an exotic OS.","solutions":["Run arthas and the profiler on Linux or macOS instead.","On Windows, use WSL2 with a Linux JDK to access the Linux native lib.","If you have a custom-built native lib, load it explicitly via `profiler load /path/to/lib`."],"exampleFix":"// before (on Windows)\nprofiler start\n// after (run inside WSL2/Linux)\nprofiler start","handlingStrategy":"type-guard","validationCode":"String os = System.getProperty(\"os.name\").toLowerCase();\nboolean supported = os.contains(\"linux\") || os.contains(\"mac\");\nif (!supported && libPath == null) {\n    System.err.println(\"AsyncProfiler needs Linux/Mac; use WSL on Windows\");\n}","typeGuard":"static boolean profilerOsSupported() {\n    String os = System.getProperty(\"os.name\", \"\").toLowerCase();\n    return os.contains(\"linux\") || os.contains(\"mac\");\n}","tryCatchPattern":"null","preventionTips":["Run the profiler on Linux or macOS only.","On Windows use WSL2 with a Linux JDK.","Provide a custom lib via `profiler load` if you have one."],"tags":["arthas","profiler","unsupported-os","windows","environment"],"backgroundTag":null,"analyzedSha":"21cf2e9ba52b305290be7223b980ff504bb9cb5b","analyzedAt":"2026-08-14T00:57:07.243Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}