Profile Image

What is Memory tracking: -XX:NativeMemoryTracking?

What is Memory tracking: -XX:NativeMemoryTracking? Have you used this JVM arguement before? What are the pros & cons of using this Java argument? Can you share your perspective/experience in using this JVM argument?

  • jvmargument

  • xx-nativememorytracking

  • x-nativememorytracking

  • Memory tracking

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky



You can enable memory tracking with:


-XX:NativeMemoryTracking=mode, where mode is one of

  • off - Instructs not to track JVM native memory usage. This is the default behavior if you don’t specify the -XX:NativeMemoryTracking option.
  • summary - Tracks memory usage only by JVM subsystems, such as Java heap, class, code, and thread.
  • detail - In addition to tracking memory usage by JVM subsystems, track memory usage by individual CallSite, individual virtual memory region and its committed regions.




Will enable memory tracking with a summary mode:






The Native Memory Tracking (NMT) is a Java HotSpot VM feature that tracks internal memory usage for a Java HotSpot VM. For details about NMT scope, how to enable NMT, and other additional usage details, see Native Memory Tracking. Since NMT doesn't track memory allocations by non-JVM code, you may have to use tools supported by the operating system to detect memory leaks in native code. The following sections describe how to monitor VM internal memory allocations and diagnose VM memory leaks.


Default Value:


Disabled by default






Arguments related:


TODO link -Xloggc:gc


Related Posts:



If you have additional comments, interesting experiences or even point of disagreement with this JVM argument description, please leave a comment. Your insights will help the entire 10+ million java developer community to develop one standard source of documentation for all the JVM arguments.

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • jvmargument

  • xx-nativememorytracking

  • x-nativememorytracking

  • Memory tracking