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

Posted by Markus Jevring on Stack Overflow See other posts from Stack Overflow or by Markus Jevring
Published on 2010-05-20T08:10:58Z Indexed on 2010/05/20 8:20 UTC
Read the original article Hit count: 172

Filed under:
|

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:

  1. 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)?
  2. 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?

© Stack Overflow or respective owner

Related posts about java

Related posts about garbage-collection