Search code examples
jvmvisualvmjvisualvm

out of memory error when use the VisualVm to analysis heap dump


when use the heap dump of visualVm, there is an option to see all the instances of a specific class, but when the instances is to much, i got this error:

out of memory in heap walker: To avoid this error,increase the -Xmx value in the etc/netbeans.conf file in NetBeans IDE installation directory.

But the error should have nothing to do with the netbeans.conf, it should be something like a visualVM.conf file. And I also did not find the configuration file in my jdk. So how can i solve this error?


Solution

  • There are two solutions for this :

    • 1.using command line to start the JvisualVM, e.g: jvisualvm -J-Xms1024m -J-Xmx2048m
    • 2.update the properties in %JDK_HOME%\lib\visualvm\etc\visualvm.conf

    Option 1 is more convenient and recommended