<?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>Xceptance Blog &#187; tuning</title>
	<atom:link href="http://blog.xceptance.com/tag/tuning/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.xceptance.com</link>
	<description>Passionate Testing</description>
	<lastBuildDate>Sat, 21 Jan 2012 11:29:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.4</generator>
		<item>
		<title>XLT &#8211; Garbage Collector details visualized</title>
		<link>http://blog.xceptance.com/2011/02/17/xlt-garbage-collector-details-visualized/</link>
		<comments>http://blog.xceptance.com/2011/02/17/xlt-garbage-collector-details-visualized/#comments</comments>
		<pubDate>Thu, 17 Feb 2011 04:00:29 +0000</pubDate>
		<dc:creator>Rene</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Performance]]></category>
		<category><![CDATA[Testing]]></category>
		<category><![CDATA[XLT]]></category>
		<category><![CDATA[charts]]></category>
		<category><![CDATA[gc]]></category>
		<category><![CDATA[JVM]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://blog.xceptance.de/?p=535</guid>
		<description><![CDATA[Today we want to give you a small preview of an upcoming XLT feature. Most of you probably know that XLT features agent statistics. These statistics help you to keep an eye on the health of the test execution engines (agents) to ensure that you do not influence the test results by providing insufficient hardware [...]]]></description>
			<content:encoded><![CDATA[<p>Today we want to give you a small preview of an upcoming XLT feature. Most of you probably know that XLT features agent statistics. These statistics help you to keep an eye on the health of the test execution engines (agents) to ensure that you do not influence the test results by providing insufficient hardware or by applying no or incorrect settings.</p>
<p>Most modern programming languages are virtual machine based and these machines have knobs you can turn to adjust their behavior according to your requirements. XLT runs on Java and so all the things you might have already learnt from tuning your Java-based servers apply to XLT as well. If you do not have experience in tuning your Java-based servers, you will learn a lot that can be applied to your servers and help you to increase performance.</p>
<p>So, let&#8217;s take a look at the upcoming XLT feature that provides you with more details about garbage collection (GC) without the need to use any external tool to monitor or analyze logs or JVMs runtime behavior.</p>
<div id="attachment_536" class="wp-caption aligncenter" style="width: 210px"><a rel="lightbox" href="/wp-content/uploads/2011/02/xlt-memory-and-gc-charts-good.png"><img class="size-thumbnail wp-image-536   " title="Example of XLT agent memory details - good example" src="/wp-content/uploads/2011/02/xlt-memory-and-gc-charts-good-200x200.png" alt="" width="200" height="200" /></a><p class="wp-caption-text">Perfect GC behavior</p></div>
<p>This is a chart displays nice memory statistics that indicate absolutely no problems with the garbage collection. As you can see the memory usage (first chart in the image) is alternating but never touching the upper limit. The second chart gives you the times when full garbage collection occurred, basically these are the bad events. Events that block the virtual machine from continuing to run. We should avoid these at any cost&#8230; nearly, because a full GC is costly. There was only one full GC right at the beginning at the test. This is a normal JVM behavior. So we seem to have done a pretty good job. No major collection of garbage. Sweat!</p>
<p>There are still the minor collections. Minor collections occur frequently and they reclaim small portions of memory with short living objects. The third charts shows us, that minor collection took about 10 to 30 ms, some spikes up to 70 ms. This is acceptable.</p>
<div class="wp-caption aligncenter" style="width: 210px"><a rel="lightbox" href="/wp-content/uploads/2011/02/xlt-memory-and-gc-charts-bad.png"><img title="Example of XLT memory example with bad data" src="/wp-content/uploads/2011/02/xlt-memory-and-gc-charts-bad-200x200.png" alt="" width="200" height="200" /></a><p class="wp-caption-text">GC with Issues</p></div>
<p>Ok, let&#8217;s have a bad example in comparison. It runs with almost default VM settings. This means just min and max heap were set (Xms256MB/Xmx512MB). You can see clearly that a lot of major collections were running for up to 800 ms each. Also the minor collections were longer.</p>
<p>Clearly, the new charts help you see and fix misbehavior quickly. &#8220;What about the settings?&#8221; you might ask now. Yes, this example is not very helpful without revealing the difference between both test runs. So, we will give you the settings of the good one. The bad run had only Xms and Xmx set, as mentioned before.</p>
<blockquote>
<pre>## Set minimum memory to use
-Xms512m

## Set maximum permitted memory
-Xmx512m

## Enable concurrent old GC to avoid sudden long pauses
-XX:+UseConcMarkSweepGC

## When to start GC for the tenured/old area of the memory.
## This has to be low enough to avoid that threads need
## memory and can not get any before the GC has finished.
## This will lower the wait time.
-XX:CMSInitiatingOccupancyFraction=70
</pre>
</blockquote>
<p>That&#8217;s really all. The use of the Concurrent-Mark-Sweep-Collector (CMS) is the most important setting. The CMS does not block the main VM worker threads, but collects the garbage concurrently. Because there might be situations were the CMS collector is not fast enough in cleaning up, this means the old space runs out of free memory, we give the CMS a hint with the last line. This line explicitly tells the CMS to start early with the clean up. In this case at a 70% fill level. The default is 96% and way too high.</p>
<p>One last thing. Setting Xms and Xmx to the same number helps the VM to relax because it will not try to get back to the minimal memory limit (Xms) and so it cleans less aggressively.</p>
<p>If you want to lean more about Java Garbage Collection, take a look at this Oracle documents: <a href="http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html">GC Tuning</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xceptance.com/2011/02/17/xlt-garbage-collector-details-visualized/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Softreferenzen gehen jederzeit</title>
		<link>http://blog.xceptance.com/2008/10/22/softreferenzen-java-gc/</link>
		<comments>http://blog.xceptance.com/2008/10/22/softreferenzen-java-gc/#comments</comments>
		<pubDate>Wed, 22 Oct 2008 06:00:08 +0000</pubDate>
		<dc:creator>Rene</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[gc]]></category>
		<category><![CDATA[tuning]]></category>

		<guid isPermaLink="false">http://blog.xceptance.de/?p=71</guid>
		<description><![CDATA[Softreferenzen (soft references) in Java sind eine tolle Sache, denn es lassen sich tolle Caches und Notfallszenarien damit bauen. Was kaum jemand weiß, dass Softreferenzen nicht nur im Falle von akuter Speicherknappheit freigegeben werden, sondern durchaus auch früher. Letzteres kann zu unerwarteten Nebenwirkungen führen, speziell mit Blick auf Caching. Soft references are kept alive longer [...]]]></description>
			<content:encoded><![CDATA[<p>Softreferenzen (soft references) in Java sind eine tolle Sache, denn es lassen sich tolle Caches und Notfallszenarien damit bauen. Was kaum jemand weiß, dass Softreferenzen nicht nur im Falle von akuter Speicherknappheit freigegeben werden, sondern durchaus auch früher. Letzteres kann zu unerwarteten Nebenwirkungen führen, speziell mit Blick auf Caching.</p>
<blockquote><p>Soft references are kept alive longer in the server virtual machine than in the client.  The rate of clearing can be controlled with the command line option <kbd>-XX:SoftRefLRUPolicyMSPerMB=&lt;N&gt;</kbd>, which specifies the number of milliseconds a soft reference will be kept alive (once it is no longer strongly reachable) for each megabyte of free space in the heap.</p>
<p>The default value is 1000 ms per megabyte, which means that a soft reference will survive (after the last strong reference to the object has been collected) for 1 second for each megabyte of free space in the heap.  Note that this is an approximate figure since soft references are cleared only during garbage collection, which may occur sporadically.</p></blockquote>
<p>Quelle: <a href="http://java.sun.com/javase/technologies/hotspot/gc/gc_tuning_6.html#other_considerations">JDK 6 Garbage Collection Tuning Guide</a></p>
<p>Nachtrag: Erwähnenswert ist auch dieser <a href="http://jeremymanson.blogspot.com/2009/07/how-hotspot-decides-to-clear_07.html">Blogeintrag von Jeremy Manson</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.xceptance.com/2008/10/22/softreferenzen-java-gc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

