4

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?

Ray
  • 477
  • 1
  • 6
  • 18
  • In case of a stand-alone installation, it’s the `etc/visualvm.conf` within the installation directory. For the version shipped with the JDK check for `lib/visualvm/etc/visualvm.conf` within the JDK installation directory. But note that you can also specify options like `-J-Xmx5G` on the command line, to override it for a single run. – Holger Apr 09 '19 at 09:35
  • Thanks for the answer, it is a stand-alone installation for me. I solve this by using the command line – Ray Apr 10 '19 at 02:56

1 Answers1

6

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

Ray
  • 477
  • 1
  • 6
  • 18