<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>What I Learned Today &#187; garbagecollection</title>
	<atom:link href="http://christiansons.net/mike/blog/tag/garbagecollection/feed/" rel="self" type="application/rss+xml" />
	<link>http://christiansons.net/mike/blog</link>
	<description>Mike Christianson&#039;s journal of Java, Ant, SVN, Jetty, cygwin and other stuff.</description>
	<lastBuildDate>Wed, 04 Aug 2010 22:24:04 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>GCViewer, garbage collection and heap analysis tool</title>
		<link>http://christiansons.net/mike/blog/2009/01/gcviewer-garbage-collection-and-heap-analysis/</link>
		<comments>http://christiansons.net/mike/blog/2009/01/gcviewer-garbage-collection-and-heap-analysis/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 23:46:48 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[garbagecollection]]></category>
		<category><![CDATA[gcviewer]]></category>
		<category><![CDATA[tool]]></category>

		<guid isPermaLink="false">http://blog.christiansons.net/?p=94</guid>
		<description><![CDATA[One month ago I wrote about the benefits of using Java&#8217;s built-in garbage collection logging.  With it, you can find answers to important important questions such as &#8220;how much memory is my app using&#8221; and &#8220;how much time is being spent doing garbage collection.&#8221; There is, of course, a hitch: for any non-trivial application or [...]]]></description>
			<content:encoded><![CDATA[<p>One month ago I wrote about the benefits of using <a href="http://christiansons.net/mike/blog/2008/12/java-garbage-collection-logging/">Java&#8217;s built-in garbage collection logging</a>.  With it, you can find answers to important important questions such as &#8220;how much memory is my app using&#8221; and &#8220;how much time is being spent doing garbage collection.&#8221;</p>
<p>There is, of course, a hitch: for any non-trivial application or problem, you will be quickly buried by a mountainous log file.  The longer your application runs, the larger the log file.  It keeps growing, and growing, and&#8230;</p>
<div id="attachment_98" class="wp-caption alignright" style="width: 160px"><a href="http://christiansons.net/mike/blog/wp-content/uploads/2009/01/gcviewer-screenshot.png"><img class="size-thumbnail wp-image-98" title="gcviewer-screenshot" src="/mike/blog/wp-content/uploads/2009/01/gcviewer-screenshot-150x150.png" alt="GCViewer" width="150" height="150" /></a><p class="wp-caption-text">GCViewer</p></div>
<p>What will you do?  Write a second Java app, one that parses the log file &#8212; attempt a homegrown analysis tool?  No!  Instead, I suggest you use <a title="GCViewer homepage" href="http://www.tagtraum.com/gcviewer.html">GCViewer</a>, a free open-source tool for visualizing the <a href="http://christiansons.net/mike/blog/2008/12/java-garbage-collection-logging/">Java gc log file</a>.</p>
<p><a title="GCViewer homepage" href="http://www.tagtraum.com/gcviewer.html">GCViewer</a> helps you get a quick and comprehensive look at how your application is behaving.  Things like total heap vs. heap used and full GC events become very apparent.  Useful statistics such as time spent during GC are calculated for your convenience.</p>
<p>GCViewer is created by <a href="http://www.tagtraum.com/">tagtraum industries</a> and is available under an <a href="http://www.gnu.org/licenses/lgpl.html">LGPL</a> license.</p>
]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2009/01/gcviewer-garbage-collection-and-heap-analysis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Java garbage collection logging</title>
		<link>http://christiansons.net/mike/blog/2008/12/java-garbage-collection-logging/</link>
		<comments>http://christiansons.net/mike/blog/2008/12/java-garbage-collection-logging/#comments</comments>
		<pubDate>Thu, 11 Dec 2008 08:00:56 +0000</pubDate>
		<dc:creator>Mike Christianson</dc:creator>
				<category><![CDATA[java]]></category>
		<category><![CDATA[garbagecollection]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.christiansons.net/?p=28</guid>
		<description><![CDATA[Java&#8217;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 [...]]]></description>
			<content:encoded><![CDATA[<p>Java&#8217;s built-in garbage collection logging provides a quick, easy, and <em>free</em> way to profile or troubleshoot your Java application.  It can help you understand your application in terms of:</p>
<ul>
<li> memory usage (object count and size)</li>
<li>heap size (initial and over time)</li>
<li>GC metrics (frequency, pause time, and amount freed)</li>
</ul>
<p>So, now you can answer questions like &#8220;how much memory is my app using,&#8221; &#8220;how much time is being spent doing garbage collection,&#8221; and &#8220;how big is the heap over time.&#8221;</p>
<p style="border: thin dashed;">
<em>For help analyzing and visualizing a GC log file, be sure to check out <a href="http://christiansons.net/mike/blog/2009/01/gcviewer-garbage-collection-and-heap-analysis/">GCViewer, a garbage collection and heap analysis tool</a>.</em>
</p>
<p>GC logging is enabled using JVM arguments; below are the arguments I use.  <span id="more-28"></span>(Note: the log file specified as <em>file</em> is reset each time the VM starts.)</p>
<p><code>-verbose:gc -Xloggc:<em>file</em></code></p>
<p>Here&#8217;s an example GC log file which shows three GC events including one full GC.</p>
<pre>[GC 19062K-&gt;7172K(60800K), 0.0087190 secs]
[GC 9346K-&gt;7525K(60800K), 0.0052810 secs]
[Full GC 7525K-&gt;7477K(60800K), 0.0615190 secs]</pre>
<p>In the first event, garbage collection takes just under nine thousandths of a second to collect 11,890K memory used by objects (19,062K to 7,172K) while the heap is 60,800K.  The last event is a full GC lasting just over six hundredths of a second to free up 48K with no change in the heap.</p>
<p>Data like this can be invaluable in saving one&#8217;s sanity or ending arguments! For further details on garbage collection, see Sun&#8217;s <a title="article on GC Portal" href="http://java.sun.com/developer/technicalArticles/Programming/GCPortal/">GC Portal</a> and <a title="doc on GC tuning" href="http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html">Virtual Machine Garbage Collection Tuning</a> documentation.</p>
]]></content:encoded>
			<wfw:commentRss>http://christiansons.net/mike/blog/2008/12/java-garbage-collection-logging/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
	</channel>
</rss>
