Can one monitor the internal memory allocation within a JVM via perfmon or top ?
Last Updated July 29, 2014
Can one monitor the internal memory allocation within a JVM via perfmon on Windows or top on Linux?
Windows perfmon or the Linux top command lets you only monitor the only the Java process itself, not the internals such as the Java heap memory allocation and so forth. In general, if you would want to use perfmon to monitor Java process internals you would require to use an extension DLL to the performance monitor and communicating with that via a memory mapped file. (see as reference http://www.developer.com/java/data/article.php/3087741 )
However, this is nothing we do at the moment for performance reasons and it is more efficient to hook a debugger directly onto the JVM during debugging and development time then to invest in implementing such a hook into our product.
In short, perfmon and other monitoring tools such as top, would only let you monitor the overall system and JVM behaviour, but not the executed Java programs and memory usage within the JVM adequately. However, what they can do alternatively is to enable JVM native and use one of the following JVM arguments to monitor memory behaviour.