The Artima Developer Community
Sponsored Link

Java Community News
A Primer on JVM Memory Pool Sizing, Generational GC

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Frank Sommers

Posts: 2642
Nickname: fsommers
Registered: Jan, 2002

A Primer on JVM Memory Pool Sizing, Generational GC Posted: Aug 15, 2007 10:06 AM
Reply to this message Reply
Summary
Sun's Stefan Schneider wrote up a brief overview of HotSpot garbage collection and memory pool sizing techniques, and describes use-cases for two JDK 6 performance tuning tools, visualgc and jconsole.
Advertisement

Starting with the assumption that most applications can trust the JVM to automatically pick the right garbage collection and memory pool sizing strategy, Sun engineer Stefan Schneider nevertheless thinks it's still important for developers to have a strong grasp of HotSpot's GC and memory management concepts. Schneider wrote up a short primer on these subjects in A short Primer to Java Memory Pool Sizing and Garbage Collectors.

After describing the various stages of generational GC, Schneider writes that,

The entire tuning of these pools is based on [a few] principles:

  • The new generation should be large enough to keep all temporary objects until they are getting dereferenced.
  • The old generation should host all permanent objects
  • Young generation garbage collections (GC) are unavoidable. Their run time typically grows with the number of objects.
  • The young generation GC is typically cheap compared to the old generation GC
  • Old generation GC should be avoided. They're needed to clean up objects which aren't permanent, yet they slipped through the young generation GC.

The best way to get a feeling for these decisions is to get a quantitative understanding of the application by attaching visualgc or a jconsole...

Visualgc ... allows me to understand the state of the VM with one look while passing by a monitor. Jconsole or the Netbeans 6.0 profilers are the tools for a deeper understanding.

Scheider then presents a 30-minute screencast of JVM tuning using those two tools, exploring in visual detail scenarios such as:

  • An undersized VM with not enough memory
  • A VM with an increased old generation and a to small young generation
  • A VM setup with parallel new generation and mostly concurrent garbage collections
  • A VM sized as before yet with an increased young generation
  • A well sized VM with increased threshold levels for survivor space with a short jconsole demo

What are your favorite tools for monitoring JVM GC?

Topic: Simon Willison: jQuery for JavaScript Programmers Previous Topic   Next Topic Topic: Gregor Hohpe: Mashups == EAI 2.0?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use