Does invoking System.gc() in java suggest garbage collection of the tenured generation as well as the young generation?

garbage-collection, java

Solution

http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#other_considerations states that System.gc() triggers a `major` collection, i.e. including tenured.

Have you seen this not to be the case in the GC logs?

Problem

When invoking `System.gc()` in java (via JMX), it will dutifully (attempt to) clean the young generation. This generally works very well. I have never seen it attempt to clean the tenured generation, though. This leads me to two questions: - Can the tenured generation even be collected (i.e. is there actually garbage in this generation, or do all objects in the tenured generation actually still have live references to them)? - If the tenured generation can be collected, can this be done via System.gc(), or is there another way to do it (unlikely), or will I simply have to wait until I run out of space in the tenured generation?

Original source