window下使用arthas分析JVM内存


D:\>java -jar arthas-boot.jar
[INFO] arthas-boot version: 3.5.3
[INFO] Found existing java process, please choose one and input the serial number of the process, eg : 1. Then hit ENTER.
  [1]: 20308
  [2]: 40756 org.jetbrains.idea.maven.server.RemoteMavenServer36
  [3]: 31384 org.jetbrains.jps.cmdline.Launcher
  [4]: 35244 com.jason.io.Math
4
[INFO] arthas home: C:\Users\jiahongfei\.arthas\lib\3.5.3\arthas
[INFO] Try to attach process 35244
[ERROR] Start arthas failed, exception stack trace:
com.sun.tools.attach.AttachNotSupportedException: 拒绝访问。
        at sun.tools.attach.WindowsVirtualMachine.<init>(WindowsVirtualMachine.java:64)
        at sun.tools.attach.WindowsAttachProvider.attachVirtualMachine(WindowsAttachProvider.java:69)
        at com.sun.tools.attach.spi.AttachProvider.attachVirtualMachine(AttachProvider.java:194)
        at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:250)
        at com.taobao.arthas.core.Arthas.attachAgent(Arthas.java:101)
        at com.taobao.arthas.core.Arthas.<init>(Arthas.java:26)
        at com.taobao.arthas.core.Arthas.main(Arthas.java:139)
[ERROR] attach fail, targetPid: 35244

找了一堆资料,没有找到对应的问题,求解

arthas是依赖jdk自带工具,像jps、jmap、jinfo等等,建议你重新安装一下jdk环境变量,jre和jdk都要配置一下