jvm-mon
jvm-mon copied to clipboard
Calculating values for heap usage for plotting the graph
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.
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.
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.
Ah, ok. It just polls memory usage every 1 second.