VisualVM “not supported for this JVM” on all local applications?

前端 未结 14 2353
故里飘歌
故里飘歌 2020-12-16 09:05

I have already spent a long time to load and test my application, now I need to profile it. But unluckily, the VisualVM always says \"not supported for this JVM\" on my loca

14条回答
  •  清歌不尽
    2020-12-16 09:40

    I too got the same problem for local tomcat, I search for solutions for stackoverflow. after some serious debugging, I figured out that VisualGC don't have permissions to get GC informations from tool.jar file.

    by links

    http://docs.oracle.com/javase/7/docs/technotes/tools/share/jstatd.html#SECURITY https://stackoverflow.com/a/42107355/3876619

    I following steps to solve the issue

    1) Create a permission file

    vim /tmp/tools.policy
    

    Add

    grant codebase "file:${java.home}/../lib/tools.jar" {
       permission java.security.AllPermission;
    };
    

    save it

    2) Now add /tmp/tools.policy to JVM startup parameters

    -Djava.security.policy=/tmp/tools.policy
    

    3) Run jvisualVm with sudo

提交回复
热议问题