aspose file tools
The moose likes Performance and the fly likes java garbage collection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Performance
Reply Bookmark "java garbage collection" Watch "java garbage collection" New topic
Author

java garbage collection

luri ron
Ranch Hand

Joined: Dec 11, 2008
Posts: 86
while tuning the gc parameter, why do we sometimes want to allow object to age more in the young generation before the objects are moved the old generation? is it because the young generation collector perform better than the old generation collector? or is it more expensive to move the memory from young generation to old generation during gc? thanks.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5533

Major collection typically take longer than minor collections, therefore you want to delay moving objects to the tenured generation as long as possible. By having a high tenuring threshold, there is a greater chance that an object will go out of scope and become unused and be cleaned up by a minor collection.

Of course, if you have objects that expect to survive a long time, then you would really want to move them to the tenured generation as soon as possible. But analysis of heap object has shown that short lived objects vastly outnumber long lived objects, so the preference is to have a high tenuring threshold.

See also: http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html, especially the graph on object lifetimes.


JBoss In Action
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: java garbage collection
 
Similar Threads
Clarification of Java Generation and Garbage Collector concepts?
GC: Major Collections Taking Long Time
UseParNewGC or UseParallelGC
Garbage Collection Implemention Questions
what algorithm does a Garbage collector use?