Not able to enable Native memory tracking in a spring boot application
Change the order of arguments:
java -XX:NativeMemoryTracking=summary -Dlogging.config=log4j2.xml -jar application.jar
This is a pecularity of java
launcher. -XX:NativeMemoryTracking
must be handled both by the launcher and by the JVM in order to take effect. However, the launcher stops processing arguments as soon as it sees a terminal option. -jar
is one them.