VisualVM unable to sampler memory

前端 未结 10 1727
甜味超标
甜味超标 2021-02-03 23:18

I have a tomcat instance with the JMXRemote parameter configured. The local VisualVM is able to get a sampler on CPU, however, not for Memory. The memory button is grayed out wi

相关标签:
10条回答
  • 2021-02-03 23:34

    And I have the same problem.

    I always launched tomcat as a service and connected it with visualvm through jmx connection.

    When had corrected catalina.bat:

        set JAVA_OPTS=%JAVA_OPTS% 
        -Dcom.sun.management.jmxremote=true 
        -Dcom.sun.management.jmxremote.port=9090 
        -Dcom.sun.management.jmxremote.ssl=false 
        -Dcom.sun.management.jmxremote.authenticate=false
    

    and launched it with startup.bat, visualvm automatically determine tomcat, and memory sampling was active.

    0 讨论(0)
  • 2021-02-03 23:38

    This blog post leads me to believe that the temp directories of JVisualVM and Tomcat need to be the same for memory sampling to work. One of the comments on the post:

    the temp directory must be set to the one used by JVisualVM, which can be discovered from the VisualVM system properties tab (java.io.tmpdir). Once I set the CATALINA_TMPDIR directory properly, this worked beautifully.

    0 讨论(0)
  • 2021-02-03 23:41

    I had the same problem before. You must have downloaded the version from jvisualvm homepage, right? Don't do it! If you use new jdk 1.7, VisualVM is already packaged in your jdk folder. Use this version, you will not have any problem with memory sample.

    0 讨论(0)
  • 2021-02-03 23:43

    I've got the same problem but with different envirnoment. My server was a Linux machine, the client a Windows 7 machine, but the problem is the same.

    The solution was to launch the jvisualvm in the same machine and with the same user that is running the targeted application. If i run jvisualvm with other other user (ex: root) the memory button became gray.

    0 讨论(0)
提交回复
热议问题