You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tomee.apache.org by "Artur Linhart (Jira)" <ji...@apache.org> on 2019/11/13 15:24:00 UTC

[jira] [Created] (TOMEE-2738) TomEE windows service does not support Java Native Memory Tracking feature

Artur Linhart created TOMEE-2738:
------------------------------------

             Summary: TomEE windows service does not support Java Native Memory Tracking feature
                 Key: TOMEE-2738
                 URL: https://issues.apache.org/jira/browse/TOMEE-2738
             Project: TomEE
          Issue Type: Bug
          Components: TomEE Core Server
    Affects Versions: 8.0.0-Final, 7.1, 1.7.5, 7.0.0
            Reporter: Artur Linhart


In the case the user specifies some from the the NativeMemoryTracking parameters (see 
[https://docs.oracle.com/en/java/javase/11/vm/native-memory-tracking.html#GUID-0DB3B8D1-8D7D-447F-B6FF-15620103EE47 |https://docs.oracle.com/en/java/javase/11/vm/native-memory-tracking.html#GUID-0DB3B8D1-8D7D-447F-B6FF-15620103EE47]
) like 

-XX:NativeMemoryTracking=summary

in Windows service registry, restarts the service, so the option can be seen in the log file by the startup options, then the Native memory tracking is still disabled and does not work. If you try with

jcmd <pid> VM.native_memory summary

to get the information about the native JVM memory in the tomcats JVM, the jcmd call fails with the message

<pid>:
Native memory tracking is not enabled

and in the Tomcat's log file can be found following error message:

Java HotSpot(TM) 64-Bit Server VM warning: Native Memory Tracking did not setup properly, using wrong launcher? 

The problem seems to be in the JVM launcher Procrun, which dies not initialize the JVM properly - as far as I have understood from this blog: 
[https://blogs.oracle.com/poonam/using-nmt-with-custom-jvm-launcher |https://blogs.oracle.com/poonam/using-nmt-with-custom-jvm-launcher]
The Procrun.exe has to define some environment variable before the start of JVM, etc. to get the native memory tracking to work.

Known workaround is the start of Tomcat from the command line, but this is no option in the productive environment, where you have to let the service run for longer time to collect the proper result and maybe also as some different user because of security concerns, then such option is simply out of possible scenarios. So the Tomcat service JVM cannot be in such circumstances tracked by NMT at all, what is the problem in the mission-critical applications.

The Procrun should be modified in the way it enables the NMT in the windows service by the startup, by setting the environment variable 
NMT_LEVEL_<pid> to the value "detail" or "summary" (or "off" if unspecified) in the dependency on the specified or unspecified option of 
-XX:NativeMemoryTracking
like done normally by java.exe
Remark: Also change of the startup mode from "jvm" to "exe" or "java" does not help,. then the windows service does not start at all.

See also the Tomcat bug 
[https://bz.apache.org/bugzilla/show_bug.cgi?id=63922|https://bz.apache.org/bugzilla/show_bug.cgi?id=63922]


 



--
This message was sent by Atlassian Jira
(v8.3.4#803005)