VisualVM unable to sampler memory

前端 未结 10 1776
甜味超标
甜味超标 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:23

    I've faced similar issues with JVisualVM, I've even asked a question about it here

    A couple of insights/advices:

    1. So, in order to sample memory you don't need jmx options.
    2. I would double check whether you have 64 bit jvms installed along with 32 bit jdks on the same machine (even if they're not running and all the environment vars defined properly), I've read somewhere that sometimes it drives the JVisualVM crazy :) (yes I know it doesn't sound reasonable to us, java developers)

    3. If it doesn't work, just uninstall all jdks that you have and install only 1 that you need. It can solve the issue.

    I hope it will help you to resolve the issue, after all like Peter said these things are new and evolving

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

    I would check the version of VisualVM is exactly the same as the JVM.

    VisualVM is very version specific. I assume its still under fairly rapid development.

    (Re posted as an answer as it may be the solution)

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

    Here is my solution for similar problem: https://stackoverflow.com/a/16330238/715483

    You can resolved this error by

    $ ssh -Y user@remotemachine

    $ wget http://java.net/projects/visualvm/downloads/download/release135/visualvm_135.zip

    $ unzip visualvm_135.zip

    $ cd visualvm_135/bin

    $ ./visualvm

    This instance of visualvm will be full featured, including memory and CPU sampling.

    Read more about it here: http://shahriarinia.blogspot.com/2013/05/java-cpumemory-heap-usage-monitoring.html

    http://mshahriarinia.com/

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

    I've just run into this same issue and the answers above solved my problem but it took me a while to figure out how. Just in case anyone else is still having trouble and ends up this far down the thread, I was using the JDK that is part of the weblogic server configured through Eclipse and not the JDK that I installed seperately. I'm still a junior programmer and I wasn't putting 2 and 2 together until I started looking through my eclipse settings and verified my Installed JREs.

    Ran the jvisualvm.exe from the weblogic jdk and all worked.

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

    Make sure your VirtualVM/JDK is a 32-bit copy if your JRE is. If you are using Eclipse, check the selected JRE on Installed JRE's section.

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

    Firstly, JMX should be enabled. Add the linked command line environment variables necessary to activate JMX if you haven't.

    The environment variable CATALINA_TMPDIR should be set to match the JVisualVM as seen in the "System properties" tab of the Local > VisualVM. You can open this by double clicking on the "VisualVM" labeled entry in the Applications pane on the left.

    Environment variables can be set by searching for environment, "edit environment variables for your account". New... > Enter a name and value.

    If you would like the temporary directory of VisualVM to be somewhere else, you'll have to launch VisualVM from the command line and add an argument.

    C:\Program Files\Java\jdk1.8.0_65\bin>jvisualvm.exe -J-Djava.io.tmpdir=C:\Users\You\Temp
    
    0 讨论(0)
提交回复
热议问题