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

Peter B. Kessler Peter.B.Kessler at Oracle.COM
Wed Oct 31 23:54:28 UTC 2012


If your goal is really to measure memory usage without garbage, then you might be interested in jmap[1], in particular "jmap -histo:live pid".  (You can find the pid with jps[2].)

			... peter

[1] http://docs.oracle.com/javase/6/docs/technotes/tools/share/jmap.html
[2] http://docs.oracle.com/javase/6/docs/technotes/tools/share/jps.html

Ashish Saxena wrote:
> 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