Channels ▼

Eric Bruno

Dr. Dobb's Bloggers

Java Garbage Collection Info and Tuning

November 29, 2009

Carol McDonald, a Java Architect at Sun, has put together a very nice set of slides on the concepts behind garbage collection (GC) in Java, how to tune your application for the best GC performance, and tools to help you further. This was part of a presentation she gave, which I unfortunately was not at.

Her blog entry is here (with lots of links): 

Or you can find just the slides at:

Overall, the slides are very good, and cover the basics of what garbage collection is, how Java uses the concept of "generations" to speed up most collections, and how object pooling (a technique people use to "help" the GC) actually make it worse. I suggest you take a look at the slide and read further on the topic. Having the skills to tune the JVM and GC can do wonders for any Java application's performance.

References and More Information

Here are some links from Carol's slides, as well as some of my own.

Inside the G1 Garbage Collector:


Real-time Garbage Collection:


Finding Memory Leaks Using the NetBeans Profiler.Performance, Monitoring and Management, Testing, and Debugging of Java Applications:




Memory management white paper:


Destructors, Finalizers, and Synchronization:


Memory-retention due to finalization article:


Help finding bugs:


Heap analysis tools Monitoring and Management:


Troubleshooting guide:





Happy coding (and garbage collecting)!



Related Reading

More Insights

Currently we allow the following HTML tags in comments:

Single tags

These tags can be used alone and don't need an ending tag.

<br> Defines a single line break

<hr> Defines a horizontal line

Matching tags

These require an ending tag - e.g. <i>italic text</i>

<a> Defines an anchor

<b> Defines bold text

<big> Defines big text

<blockquote> Defines a long quotation

<caption> Defines a table caption

<cite> Defines a citation

<code> Defines computer code text

<em> Defines emphasized text

<fieldset> Defines a border around elements in a form

<h1> This is heading 1

<h2> This is heading 2

<h3> This is heading 3

<h4> This is heading 4

<h5> This is heading 5

<h6> This is heading 6

<i> Defines italic text

<p> Defines a paragraph

<pre> Defines preformatted text

<q> Defines a short quotation

<samp> Defines sample computer code text

<small> Defines small text

<span> Defines a section in a document

<s> Defines strikethrough text

<strike> Defines strikethrough text

<strong> Defines strong text

<sub> Defines subscripted text

<sup> Defines superscripted text

<u> Defines underlined text

Dr. Dobb's encourages readers to engage in spirited, healthy debate, including taking us to task. However, Dr. Dobb's moderates all comments posted to our site, and reserves the right to modify or remove any content that it determines to be derogatory, offensive, inflammatory, vulgar, irrelevant/off-topic, racist or obvious marketing or spam. Dr. Dobb's further reserves the right to disable the profile of any commenter participating in said activities.

Disqus Tips To upload an avatar photo, first complete your Disqus profile. | View the list of supported HTML tags you can use to style comments. | Please read our commenting policy.