Profile Image
vishnupriya

What is JVM startup parameter: -XX:NativeMemoryTracking?

What is JVM startup parameter: -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

  • JVM startup parameter

Please Sign In or to post your comment or answer

Profile Image

Pavel Khodakovsky

Usage:


 Enable Native Memory Tracking (NMT) mode. It has the following syntax: -XX:NativeMemoryTracking=mode, where mode can be one of the following modes: off, summary and detail

 

Since:

 

Starting from JDK 7.

 

Examples:

 

To enable summary mode for Native Memory Tracking:

 

java -XX:NativeMemoryTracking=summary MainClass

 

Description:

 

Native Memory Tracking (NMT) is a feature used by Hotspot VM to analyze the memory usage inside the VM. We can use the tool jcmd (which comes with jdk) to access NMT data. It has three modes:

  • off: does not track usage of native methods. This is the default mode.
  • summary: only tracks memory usage of JVM subsystems such as java heap, classes, code and threads.
  • detail: In addition to tracking memory usage by the JVM subsystem, a single call to CallSite tracks memory usage, a single virtual memory region and its delegated region.

 

Default Value:

 

By default, this option is disabled.

 

Note:

 

Turning on NMT will bring 5%-10% performance loss.

 

Related Posts:

 

Got something else on mind? Post Your Question

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

  • xx-nativememorytracking

  • x-nativememorytracking

  • JVM startup parameter