Search code examples
javamultithreadingthreadpooljfreechartheap-memory

Monitoring stack area of JVM programmatically in JAVA?


This blog briefly explains JVM memory structure and I am assuming same structure regarding my questions. Now my question is as follows.

  1. As threads make use stack and register area of memory, how to monitor stack and register parts of memory separately by programming instead of using tool like visualvm?

Solution

  • You can take a look at VisualVM It comes bundled with standard jdk installation.

    From the home page

    Monitor application performance and memory consumption. VisualVM monitors application CPU usage, GC activity, heap and permanent generation memory, number of loaded classes and running threads. You can easily detect suspicious memory consumption and take an action - invoke garbage collection in the application or take a heap dump and browse the contents of application heap.