Old generation doesn't get freed even after multiple System.gc()

Ashish Saxena anantiitrke at gmail.com
Wed Oct 31 10:20:04 UTC 2012


Hi Team,

We are observing that even after multiple full GC, JVM doesn't clear
the Old generation. Full GC do occur (as seem from GC logs), but it
performs Young generation collection followed by promotion into old
generation but the old generation collection doesn't happen.

Test:
When Heap size is low (1 GB), after multiple full GC, total heap size
after GC is around 400 MB.
But with Heap size is high(8 GB), after multiple full GC, total heap
size after GC is around 1300 MB. GC logs confirms that old generation
is not getting collected.

It seems that on receiving request for full GC,
1. JVM triggers young generation GC
2. Checks the occupancy of old generation, and triggers Old generation
GC only if there is memory pressure.

Is there a way by which we can instruct JVM to trigger Old generation
collection each time full GC is triggered ? This is required to
measure actual memory usage (without garbage) of the application.

Thanks and Regards,
Ashish A. Saxena



More information about the hotspot-gc-dev mailing list