Directory

Memory Management in the Java HotSpot™ Virtual Machine (PDF)

Rating
0 vote
Favoured:
0
One strength of the Java™ 2 Platform, Standard Edition (J2SE™) is that it performs automatic memory management, thereby shielding the developer from the complexity of explicit memory management.

This paper provides a broad overview of memory management in the Java HotSpot virtual machine (JVM) in Sun’s J2SE 5.0 release. It describes the garbage collectors available to perform the memory management, and gives some advice regarding choosing and configuring a collector and setting sizes for the memory areas on which the collector operates. It also serves as a resource, listing some of the most commonly-used options that affect garbage collector behavior and providing numerous links to more detailed documentation.

Section 2 is for readers who are new to the concept of automatic memory management. It has a brief discussion of the benefits of such management versus requiring programmers to explicitly deallocate space for data. Section 3 then presents an overview of general garbage collection concepts, design choices, and performance metrics. It also introduces a commonly-used organization of memory into different areas called generations based on the expected lifetimes of objects. This separation into generations has proven effective at reducing garbage collection pause times and overall costs in a wide range of applications.

The rest of the paper provides information specific to the HotSpot JVM. Section 4 describes the four garbage collectors that are available, including one that is new in J2SE 5.0 update 6, and documents the generational memory organization they all utilize. For each collector, Section 4 summarizes the types of collection algorithms used and specifies when it would be appropriate to choose that collector.

Section 5 describes a technique new in the J2SE 5.0 release that combines (1) automatic selection of garbage collector, heap sizes, and HotSpot JVM (client or server) based on the platform and operating system on which the application is running, and (2) dynamic garbage collection tuning based on user-specified desired behavior. This technique is referred to as ergonomics.

Section 6 provides recommendations for selecting and configuring a garbage collector. It also provides some advice as to what to do about OutOfMemoryErrors. Section 7 briefly describes some of the tools that can be utilized to evaluate garbage collection performance, and Section 8 lists the most commonly-used command line options that relate to garbage collector selection and behavior. Finally, Section 9 supplies links to more detailed documentation for the various topics covered by this paper.

Voted Best

RankName
Show more...

Latest entries

1. Internet marketing...
    www.mediactacademy.nl
    Category: Training site
    Created: Dec 9, 2011
2. Online Java Training...
    skillforge.com/courses...
    Category: Training site
    Created: Dec 4, 2010
3. WebLogic Application...
    www.infosupport.com...
    Category: Java EE
    Created: Nov 28, 2010
4. Service Oriented...
    www.infosupport.com...
    Category: Other
    Created: Nov 28, 2010
5. Oracle Fusion...
    www.infosupport.com...
    Category: Java EE
    Created: Nov 28, 2010
Show more...

Resources