jvm-mon icon indicating copy to clipboard operation
jvm-mon copied to clipboard

Calculating values for heap usage for plotting the graph

Open ReasonablyAnon opened this issue 4 years ago • 3 comments

How can I get plotted values of heap usage graph in text file ( possibly comma separated ) ? Also, I couldn't understand how exactly are you getting/calculating those values for plotting ? Can you please tell this approach, that would be more beneficial for me. Thanks in advance, means a lot.

ReasonablyAnon avatar May 02 '20 03:05 ReasonablyAnon

Hi,

It gets memory values from Java itself using Runtime: https://github.com/ajermakovics/jvm-mon/blob/master/jvm-mon-go/src/main/java/jvmmon/core/JvmMon.java#L32

If you are running 0.3 then you could add some code to write values into a text file: https://github.com/ajermakovics/jvm-mon/blob/master/src/dist/jvm-mon.js#L142 there already should be a jvm-mon.js file in your install.

ajermakovics avatar May 02 '20 10:05 ajermakovics

Thank you so much for the reply.

I mean are you calculating those values after GC happens or before GC happens. At what point of process , are you determining to get that heap usage value during the process is running ? Thats why, you are able to get many heap usage values 'throughout the whole process' for plotting right ? To get various heap usage values thoughout the process, that logic, I am trying to understand.

ReasonablyAnon avatar May 02 '20 12:05 ReasonablyAnon

Ah, ok. It just polls memory usage every 1 second.

ajermakovics avatar May 02 '20 15:05 ajermakovics