[INFRAUTILS-20] Monitorability of JVM's native memory usage Created: 03/Nov/17  Updated: 24/Sep/21  Resolved: 24/Sep/21

Status: Resolved
Project: infrautils
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Medium
Reporter: Michael Vorburger Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Blocks
blocks NETVIRT-977 Track heap & native (!) memory usage ... Resolved
is blocked by INFRAUTILS-19 Coda Hale Dropwizard Metrics integration Resolved

 Description   

while researching around NETVIRT-974, I stumbled upon some blog posts mentioning how a JVM's native memory usage can be monitored. I believe it would be useful to have a small utility (in infrautils) which uses the respective Java API, and exposes this e.g. by JMX and CLI, incl. with regular dumping.

I'll use INFRAUTILS-19 Metrics for this.



 Comments   
Comment by Michael Vorburger [ 21/Dec/17 ]

I'm currently adding BufferPoolMetricSet and MemoryUsageGaugeSet to infrautils.metrics and it seems this will gives us something related to this, but we would need the options below enabled on start-up, which is probably a bad idea to enable by default because "note that enabling this will cause 5-10% performance overhead" ...

-XX:NativeMemoryTracking=[off | summary | detail]
-XX:+UnlockDiagnosticVMOptions -XX:+PrintNMTStatistics

so I'm un-assigning myself from this issue as I don't plan to go beyond what I'm doing today in infrautils.metrics; if we suspect native memory problems in the future based on what we'll find in metrics, then we can add the JVM startup options above during lab testing to find out more.

Comment by Robert Varga [ 24/Sep/21 ]

The JVM already provides a ton of metrics via JMX without the need for any code on our part. Even more JVM-related things are available through Java Flight Recorder, so this really is about knowing how to deploy Java applications.

Generated at Wed Feb 07 20:02:03 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.