Java’s built-in garbage collection logging provides a quick, easy, and free way to profile or troubleshoot your Java application.  It can help you understand your application in terms of:

  • memory usage (object count and size)
  • heap size (initial and over time)
  • GC metrics (frequency, pause time, and amount freed)

So, now you can answer questions like “how much memory is my app using,” “how much time is being spent doing garbage collection,” and “how big is the heap over time.”

For help analyzing and visualizing a GC log file, be sure to check out GCViewer, a garbage collection and heap analysis tool.

GC logging is enabled using JVM arguments; below are the arguments I use. Continue reading »

© 2011 And now here's something… Suffusion theme by Sayontan Sinha