How to measure peak heap memory usage in Java? MemoryPoolMXBean keeps track of the peak usage per memory pool, but not the entire heap. And the peak heap usage is not simply the sum of different heap memory pools.
Did you think about using totalMemory()
function from Runtime
class - docs?
Also there are some free tools like VisualVM or JStat, example:
jstat -gc <pid> <time> <amount>
Hope that helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With