Understanding Java System Properties in Memory Analyzer Report

Memory Analyzer Reports contain various sections such as Overview, Dominator Tree, Class Histogram, Threads, Duplicate Classes, GC Roots, Unreachable Objects, OQL… One section that often goes unnoticed but can offer interesting diagnostic insights is the System Properties section. In this post let’s learn What Java System Properties are? How do they appear in HeapHero Report? Which properties are worth investigating during memory analysis.

What Are Java System Properties?

Java System Properties are key-value pairs that describe the environment in which your Java application is running. These properties are set by the JVM, the underlying operating system, or explicitly passed by engineers through -D flags at startup.

They include useful details like:

  • The version and vendor of the Java runtime
  • The OS name and architecture
  • The working directory and user
  • File encodings and separators
  • Classpath and native library paths

Systems Properties in Memory Analysis Report

Along with the information about objects in the heap, System Properties are also captured in the Heap Dump. When you analyze heap dumps in memory analyzer tools, ‘System Properties’ gets reported in the analysis reports. Below is the screen shot of the ‘System Properties’ section in the HeapHero report:

Fig: Java System Properties reported by HeapHero

What’s Interesting About System Properties During Memory Analysis?

System properties can help answer important questions:

  • Was the application running on the correct JVM version?
  • Is the heap dump from a 32-bit or 64-bit environment?
  • Is the classpath set correctly?
  • Is the default encoding appropriate for the application?
  • Could any library path misconfiguration lead to memory issues?

This metadata gives a good perspective of the production environment settings in which memory problems surfaced. They become valuable when debugging the memory leaks that are hard to reproduce locally.

What are the important System Properties?

Here are some of the important Java System Properties: 

PropertyDescription
java.versionSpecifies the version of the Java runtime in use. Example: 1.8.0_381
java.homePoints to the directory where Java is installed. Example: /usr/lib/jvm/java-8-openjdk-amd64
java.vm.versionSpecifies the internal version of the JVM. Example: 25.381-b09
java.class.pathClasspath used to load application classes and libraries. Example: /app/lib/*:/app/classes/
sun.boot.class.pathBootstrap classpath for loading core Java classes. Example: /usr/lib/jvm/…/rt.jar
user.dirWorking directory from which the JVM was started. Example: /home/appuser/app
user.nameThe user who launched the Java application. Example: appuser
os.nameName of the operating system. Example: Linux
os.versionOperating system version. Example: 5.15.0-105-generic
java.library.pathLocations where native libraries are searched. Example: /usr/lib:/lib:/usr/local/lib
file.encodingDefault character encoding used by the JVM. Example: UTF-8

Conclusion

‘System Properties’ section of the memory analyzer tool will come handy when you are trying to understand the environmental settings of the application in which a memory problem surfaced.  Hopefully there is a little bit of help in the information shared in this post.

Share your Thoughts!

Up ↑

Index

Discover more from HeapHero – Java & Android Heap Dump Analyzer

Subscribe now to keep reading and get access to the full archive.

Continue reading