How to switch the profiling mode to Memory mode in Netbeans 11's profiler?

241 Views Asked by At

I ma running Netbeans 11 on a Linux 64 bit machine (32 GB of RAM, 8 virtual CPUs) with Open JDK 11. I want to profile an app (which is an Indexer for SOLR) because after a long running period on production I get Out Of Memory errors and I see that the used memory (reported by OS) keeps increasing and never decreases. It starts at 8GB and after some days (sometimes weeks), reaches 30GB and throws OOM (Java heap space).

I can't reproduce this OOM on my dev machine (16 GB of RAM, 4 CPUs) so I decided to use Netbeans profiler and see if I could get some clues on what is causing this increase in RAM consumption over time.

I started following Netbeans article and see the following after 2 indexing processes (actually on the production server the indexing processes will succeed one another infinitely, but some indexing processes can last several days or weeks) : Surviving Generations on my project

So I guess there is a memory leak in my app. So far so good. But yet in the above mentioned Netbeans article they tell you to "Switch the profiling mode to Memory mode" (in the chapter called "Discovering the Source"). But I can't find where to switch to memory. This is how my GUI looks like :

My GUI for Netbeans profiler

If I click on "Profile Objects" then I see something near to what they show in the article, but only with "Live bytes" and "Live objects". So no mention of "Generations" as they show and the little arrow on the upper right corner does not offer it as choice (only "Name", "Live Bytes", "Live objets").

Objects profiling

Consequently am I in the right place, and if so how can I get the other columns ("Avg Age", "Generations", ...) and how can I then go to the part that is causing this memory leak in source code ? Or maybe could anybody advise another more detailed (for newbies) article / tutorial on how to profile an app to find memory leaks ?

Any help much appreciated :-)!

1

There are 1 best solutions below

0
On BEST ANSWER

So to get the "Surviving generations metrics" appear as they show in their article, you have to select "Object" and then in "Profile" select one of the "Focused (Instrumented)" choice, and check "Track only live objects" as described in Netbeans' wiki.

enter image description here