0

We are using AppDynamics and VisualVM to monitor our application heap memory usage. We see similar graph as stated in these questions - this and this.
enter image description here

  • the red boxes show idle system heap usage - peaks are seen only when system is in idle state and are even observed when no application is deployed.
  • the green arrow points to actual application in use state - When system is in use, we see relatively very less heap usage being reported. Based on the clarifications in other SO questions, if we say it is due to garbage collection, why would GC not occur during application use? When system is idle, we see system objects like java.land.String, byte[], int[] etc. getting reported in AppDynamics, but how to find who is responsible for creating them?
    Again, in the heap dumps taken during idle state, we see only 200MB out of 500MB memory used, when the server has dedicated -Xmx4g configuration.
    How should we make sense of these observations?
  • gsonal
    • 11
    • 1
    • 6

    1 Answers1

    0

    On analyzing the heap dump taken during system idle state, we only see various WebAppClassLoaders holding instances of different library classes.

    This pattern is also explained in official blogs of APM experts like Plumbr and Datadog as a sign of healthy JVM where regular GC activity is occurring and they explain that it means none of the objects will stay in memory forever.


    From Plumbr blog:

    Seeing the following pattern is a confirmation that the JVM at question is definitely not leaking memory. The reason for the double-sawtooth pattern is that the JVM needs to allocate memory on the heap as new objects are created as a part of the normal program execution. Most of these objects are short-lived and quickly become garbage. These short-lived objects are collected by a collector called “Minor GC” and represent the small drops on the sawteeth.

    gsonal
    • 11
    • 1
    • 6