This link has been bookmarked by 29 people . It was first bookmarked on 02 Mar 2006, by 涼鞋.
-
27 Sep 11
-
07 Apr 11
-
07 Apr 10
Vijay Challah the exception of GC. The top line (red) is an application spending only 1%
-
28 Apr 09
-
16 Mar 09
-
02 Mar 09
-
24 Jun 08
-
14 Nov 07
-
01 Jul 07
-
While naive garbage collection examines every living object in the heap, generational collection exploits several empirically observed properties of most applications to avoid extra work.
-
infant mortality
-
Efficient collection is made possible by focusing on the fact that a majority of objects die young.
-
To do this, memory is managed in generations: memory pools holding objects of different ages. Garbage collection occurs in each generation when it fills up;
-
Objects are allocated in eden, and because of infant mortality most objects die there. When Eden fills up it causes a minor collection, in which some surviving objects are moved to an older generation. When older generations need to be collected there is a major collection that is often much slower because it involves all living objects.
-
The young generation consists of eden plus two survivor spaces . Objects are initially allocated in eden. One survivor space is empty at any time, and serves as the destination of the next copying collection of any living objects in eden and the other survivor space. Objects are copied between survivor spaces in this way until they age enough to be tenured (copied to the old generation.)
-
One portion called the permanent generation is special because it holds all the reflective data of the JVM itself, such as class and method objects.
-
Pauses are the times when an application appears unresponsive because garbage collection is going on.
-
The parameters NewSize and MaxNewSize bound the young generation size below and above. Setting these equal to one another fixes the young generation, just as setting -Xms and -Xmx equal fixes the total heap size. This is useful for tuning the young generation at a finer granularity than the integral multiples allowed by NewRatio.
-
If desired, the parameter SurvivorRatio can be used to tune the size of the survivor spaces, but this is often not as important to performance. For example, -XX:SurvivorRatio=6 sets the ratio between each survivor space and eden to be 1:6; in other words, each survivor space will be one eighth of the young generation
-
If survivor spaces are too small, copying collection overflows directly into the old generation. If survivor spaces are too large, they will be uselessly empty
-
-
07 May 07
-
27 Feb 06
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.