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):

http://blogs.sun.com/carolmcdonald/entry/java_garbage_collection_monitoring_and 

Or you can find just the slides at:

http://www.slideshare.net/caroljmcdonald/java-garbage-collection-monitoring-and-tuning

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:

  -http://www.ddj.com/java/219401061

Real-time Garbage Collection:

  -http://www.informit.com/store/product.aspx?isbn=0137142986

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

  -http://www.javapassion.com/javaperformance/

  -http://netbeans.org/kb/docs/java/profiler-intro.html

  -http://www.netbeans.org/community/magazine/html/04/profiler.html

Memory management white paper:

  -http://java.sun.com/j2se/reference/whitepapers/

Destructors, Finalizers, and Synchronization:

  -http://portal.acm.org/citation.cfm?id=604153 

Memory-retention due to finalization article:

  -http://www.devx.com/Java/Article/30192

Help finding bugs:

  -http://findbugs.sourceforge.net

Heap analysis tools Monitoring and Management:

  -http://java.sun.com/developer/technicalArticles/J2SE/monitoring/

Troubleshooting guide:

  -http://java.sun.com/javase/6/webnotes/trouble/

JConsole:

  -http://java.sun.com/developer/technicalArticles/J2SE/jconsole.html

 

Happy coding (and garbage collecting)!

-EJB 

 

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.
 


Video