3

Allocated Heap Size is fluctuating for the java app.

I am observing in JVisualVM that Heap Size of my application is fluctuating very often. I am observing decent GC activity as well.

I am of assumption that once JVM allocates a specific Heap Size, it doesn't release any of it to OS even if the used Heap Size decreases. Can someone help me understand this behaviour.

JvisualVM Snapshot showing frequent change in Heap Size

  • Does [this](https://stackoverflow.com/questions/30458195/does-gc-release-back-memory-to-os) answer your question? – cmoetzing Jun 19 '19 at 13:08
  • Actual behavior depends on multiple factors like actual configured GC (CMS/G1C1/..) , application behavior (lots of small short lived objects vs. few bigger ones) etc.You can make heap dump and analyze it or configure JVM to print detailed GC info – rkosegi Jun 19 '19 at 13:09

0 Answers0