VisualVM unable to sampler memory

Reusable picture Reusable · Jan 10, 2012 · Viewed 30.7k times · Source

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 with a summary saying: "Memory sampling: Not available. Cannot connect to target application. Make sure the application is running on a supported JDK 6 or JDK 7"

JMXRemote parameter:

-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9086
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Tomcat JDK version:

JDK1.6.0.30

VisualVM version:

Version: 1.6.0_30 (Build 1320-110325); platform 110131-9c8b3bfb3a1e
System: Windows Server 2008 R2 (6.1) , amd64 64bit
Java: 1.6.0_30; Java HotSpot(TM) 64-Bit Server VM (20.5-b03, mixed mode)
Vendor: Sun Microsystems Inc., http://java.sun.com/
Environment: Cp1252; en_US (visualvm)
Userdir: C:\Users\Administrator\AppData\Roaming\.visualvm\7
Clusters: C:\Program Files\Java\jdk1.6.0_30\lib\visualvm\platform
C:\Program Files\Java\jdk1.6.0_30\lib\visualvm\visualvm
C:\Program Files\Java\jdk1.6.0_30\lib\visualvm\profiler

Tomcat version:

Tomcat 6.0.32

I am running both the VisualVM and Tomcat at win server 2008. Anything i did wrong?

Answer

Sifeng picture Sifeng · Apr 23, 2013

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.