This link has been bookmarked by 47 people . It was first bookmarked on 11 Jul 2006, by Alex Choi.
-
W.W. Webstersun.com
-
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.
-
-
-
Documentation
-
-
-
-
-
Garbage collector
Heap size
Runtime compiler
e goal of ergonomics is to provide good performance
from the JVM with a minimum of command line tuning. Ergonomics
attempts to match the best selection of -
Garbage collectors make assumptions about the way applications use
objects, and these are reflected in tunable parameters that can be
adjusted for improved performance without sacrificing the power of
the abstraction - 29 more annotations...
-
-
vivek sainihe lifetimes of objects.
-
he uncommitted space is labeled
"virtual" in this figure. -
The throughput collector uses multiple threads to
execute a minor collection - 1 more annotations...
-
-
-
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 example objects describing classes
and methods are stored in the permanent generation - 1 more annotations...
-
-
Serge SlipchenkoTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine
-
-
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. - 9 more annotations...
-
-
-
Srikant Jakilinkiwith the 5.0 Java[tm] Virtual Machine
-
sven duzontjava,garbage collector,tuning
-
Emmanuel HugonnetTuning Garbage Collection with the 5.0 JavaTM Virtual Machine: memory model for Java
-
-
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.
-
-
-
serial
-
-
-
-XX:+PrintGCTimeStamps
-
-
-
-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.
-
-
Wytze KoopalTuning Garbage Collection with the 5.0 Java[tm] Virtual Machine

Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.