This link has been bookmarked by 166 people . It was first bookmarked on 11 Jul 2006, by Alex Choi.
-
10 Jul 15
-
28 Sep 11
-
26 Jul 10
-
02 Jul 10
-
30 Jun 10
Istvan BanTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine
-
02 Jun 10
-
20 May 10
-
01 May 10
-
29 Apr 10
-
20 Apr 10
-
18 Apr 10
-
18 Mar 10
-
15 Mar 10
-
09 Mar 10
-
27 Feb 10
-
18 Feb 10
-
13 Feb 10
-
12 Feb 10
-
20 Jan 10
-
27 Dec 09
-
17 Dec 09
-
The JavaTM 2 Platform Standard Edition (J2SETM platform) is used for a wide variety of applications from small applets on desktops to web services on large servers. In the J2SE platform version 1.4.2 there were four garbage collectors from which to choose but without an explicit choice by the user the serial garbage collector was always chosen. In version 5.0 the choice of the collector is based on the class of the machine on which the application is started.
-
This “smarter choice” of the garbage collector is generally better but is not always the best. For the user who wants to make their own choice of garbage collectors, this document will provide information on which to base that choice. This will first include the general features of the garbage collections and tuning options to take the best advantage of those features. The examples are given in the context of the serial, stop-the-world collector. Then specific features of the other collectors will be discussed along with factors that should considered when choosing one of the other collectors.
-
-
23 Nov 09
-
18 Nov 09
-
07 Nov 09
-
16 Sep 09
-
06 Sep 09
jamessweeneyjava performance
-
26 Aug 09
-
03 Aug 09
-
17 Jun 09
-
11 Jun 09
-
26 May 09
-
14 May 09
-
he uncommitted space is labeled "virtual" in this figure.
-
The throughput collector uses multiple threads to execute a minor collection
-
Turning on the throughput collector should just make the minor collection pauses shorte
-
-
03 Apr 09
-
30 Mar 09
-
17 Dec 08
-
16 Dec 08
-
12 Dec 08
-
For example objects describing classes and methods are stored in the permanent generation
-
The permanent generation is special because it holds data needed by the virtual machine to describe objects that do not have an equivalence at the Java language level.
-
For most applications the permanent generation is not relevant to garbage collector performance. However, some applications dynamically generate and load many classes. For instance, some implementations of JSPTM pages do this. If necessary, the maximum permanent generation size can be increased with MaxPermSize.
-
-
09 Dec 08
Serge SlipchenkoTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine
-
04 Dec 08
-
31 Oct 08
-
22 Oct 08
-
13 Oct 08
-
07 Oct 08
-
05 Oct 08
-
To optimize for this scenario, memory is managed in generations, or memory pools holding objects of different ages. Garbage collection occurs in each generation when the generation fills up.
-
When the tenured generation needs to be collected there is a major collection that is often much slower because it involves all live objects.
-
The serial garbage collector is meant to be used by small applications. Its default parameters were designed to be effective for most small applications. The throughput garbage collector is meant to be used by large applications. The heap size parameters selected by ergonomics plus the features of the adaptive size policy are meant to provide good performance for server applications.
-
The command line argument -verbose:gc prints information at every collection.
-
The uncommitted space is labeled "virtual" in this figure.
-
Since collections occur when generations fill up, throughput is inversely proportional to the amount of memory available.
-
The throughput collector: this collector uses a parallel version of the young generation collector. It is used if the -XX:+UseParallelGC option is passed on the command line. The tenured generation collector is the same as the serial collector.
-
The concurrent low pause collector: this collector is used if the -Xincgc™ or -XX:+UseConcMarkSweepGC is passed on the command line. The concurrent collector is used to collect the tenured generation and does most of the collection concurrently with the execution of the application. The application is paused for short periods during the collection. A parallel version of the young generation copying collector is used with the concurrent collector.
-
Use the throughput collector when you want to improve the performance of your application with larger numbers of processors. In the serial collector garbage collection is done by one thread, and therefore garbage collection adds to the serial execution time of the application. The throughput collector uses multiple threads to execute a minor collection and so reduces the serial execution time of the application. A typical situation is one in which the application has a large number of threads allocating objects. In such an application it is often the case that a large young generation is needed.
-
The throughput collector is a generational collector similar to the serial collector but with multiple threads used to do the minor collection. The major collections are essentially the same as with the serial collector. By default on a host with N CPUs, the throughput collector uses N garbage collector threads in the minor collection.
-
The throughput collector can be enabled by using command line flag -XX:+UseParallelGC. The number of garbage collector threads can be controlled with the ParallelGCThreads command line option (-XX:ParallelGCThreads=<desired number>).
-
-
03 Oct 08
-
16 Sep 08
-
26 Aug 08
-
21 Aug 08
-
28 Jul 08
-
-
25 Jul 08
auxonne auxonneTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine
-
27 Jun 08
-
26 Jun 08
-
27 May 08
-
08 May 08
-
06 May 08
-
30 Apr 08
-
28 Apr 08
-
16 Apr 08
-
15 Apr 08
-
30 Mar 08
-
26 Mar 08
-
17 Feb 08
-
05 Feb 08
-
31 Jan 08
-
10 Jan 08
-
04 Dec 07
Isaac RuizTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine
-
20 Nov 07
-
16 Oct 07
Emmanuel HugonnetTuning Garbage Collection with the 5.0 JavaTM Virtual Machine: memory model for Java
-
02 Oct 07
-
29 Aug 07
-
28 Aug 07
-
09 Aug 07
-
30 Jul 07
-
26 Jul 07
-
11 Jul 07
-
02 Jul 07
-
Efficient collection is made possible by focusing on the fact that a majority of objects "die young".
-
Use the concurrent low pause collector if your application would benefit from shorter garbage collector pauses and can afford to share processor resources with the garbage collector when the application is running. Typically applications which have a relatively large set of long-lived data (a large tenured generation), and run on machines with two or more processors tend to benefit from the use of this collector.
-
-
29 Jun 07
-
23 Jun 07
phoenix2lifeTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine
-
21 Jun 07
-
08 Jun 07
-
09 May 07
-
25 Apr 07
-
09 Mar 07
-
23 Feb 07
-
25 Jan 07
-
24 Jan 07
-
serial
-
-
18 Dec 06
-
12 Dec 06
-
21 Nov 06
-
02 Nov 06
-
-XX:+PrintGCTimeStamps
-
-
28 Sep 06
-
-XX:MinHeapFreeRatio=
40
-XX:MaxHeapFreeRatio=
70
-Xms
3670k
-Xmx
64m
-
Unless you have problems with pauses, try granting as much memory as possible to the virtual machine. The default size (64MB) is often too small.
Setting -Xms and -Xmx to the same value increases predictability by removing the most important sizing decision from the virtual machine. On the other hand, the virtual machine can't compensate if you make a poor choice.
Be sure to increase the memory as you increase the number of processors, since allocation can be parallelized.
-
-
30 Aug 06
-
07 Aug 06
-
06 Aug 06
-
21 Jul 06
-
12 Jul 06
-
11 Jul 06
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.