<?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>Innovation On The Run &#187; java memory</title>
	<atom:link href="http://www.innovationontherun.com/tag/java-memory/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.innovationontherun.com</link>
	<description>Ruminations about innovation and software by Rob Di Marco</description>
	<lastBuildDate>Sun, 25 Oct 2009 14:44:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Java Memory Management Improvement Proposal</title>
		<link>http://www.innovationontherun.com/java-memory-management-improvement-proposal/</link>
		<comments>http://www.innovationontherun.com/java-memory-management-improvement-proposal/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 12:25:45 +0000</pubDate>
		<dc:creator>Rob Di Marco</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[java memory]]></category>

		<guid isPermaLink="false">http://www.innovationontherun.com/?p=71</guid>
		<description><![CDATA[For the umpteenth time, I had to deal with the dreaded Java OutOfMemoryError, this time when trying to run Fisheye Subversion browser.&#160; My problem deals with a known issue in Fisheye where a background indexing task sometimes runs causes an OOM error.&#160; Of course, an OOM does not just effect the indexing task, it can [...]]]></description>
			<content:encoded><![CDATA[<p>For the umpteenth time, I had to deal with the dreaded Java <a href="http://java.sun.com/javase/6/docs/api/java/lang/OutOfMemoryError.html">OutOfMemoryError</a>, this time when trying to run <a href="https://www.atlassian.com/software/fisheye/">Fisheye</a> Subversion browser.&nbsp; My problem deals with a <a href="http://jira.atlassian.com/browse/FE-624">known issue</a> in Fisheye where a background indexing task sometimes runs causes an OOM error.&nbsp; Of course, an OOM does not just effect the indexing task, it can also impact other operations unrelated to the task with the memory leak.&nbsp; While diagnosing this problem, it got me thinking about how this could be better managed.</p>
<h2>The Problem</h2>
<p>&nbsp;The JVM defines a single heap for all objects created across all threads in the java process.&nbsp; A consequence of this is that if one processing thread has a memory leak, any thread on the JVM may start suffering from OOM errors.&nbsp; However, not all threads are equally important to my application.&nbsp; I may not mind too much if a batch processing thread fails with an OOM but I may care very much if the lack of memory causes all of my Tomcat threads to no longer be able to process web requests.</p>
<h2>Proposed Solution</h2>
<p>What I would like is to be able to segment my heap so that I can dedicate portions of the heap (either by percentage of the total heap or by absolute number of bytes) to a specific set of work.&nbsp; That way if an OOM occurs, I can contain its impact to a certain set of threads while other threads continue processing.&nbsp; I would see this being configured as JVM runtime -X arguments, something like <span class="Code">-XHeapSegment:Name=MyMemHeap,Size=25%,Thread=&lt;ThreadNameRegex&gt;</span></p>
<p>I could see the partitioning being relative (by percentage) or absolute (total bytes allocated).&nbsp; I could also see linking it to ThreadGroups as opposed to just Threads.</p>
<h2>Some Questions</h2>
<ul>
<li>Do others see value in this proposal?</li>
<li>I am not an expert at JVM internals.&nbsp; Is there a fundamental reason this would not work?</li>
<li>Any other suggestions?</li>
<li>Should we allow this segmentation to be defined at compile-time as well through annotations?</li>
</ul>
<h2>Notes</h2>
<ul>
<li>For the purposes of the problem I defined, I do not have a requirement that the young generations also be segmented.&nbsp; However, if it is impractical to keep a single set of young generations and segmented older generations, I can deal with having segmentation in the young generations as well.</li>
<li>Obviously, this would in no way address all OutOfMemoryErrors.&nbsp; We can still look forward to running out of PermGenSpace</li>
</ul>
<img src="http://www.innovationontherun.com/?ak_action=api_record_view&id=71&type=feed" alt="" /><!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a title="Click me to see the sites." href="#" onclick="$$('div.d71').each( function(e) { e.visualEffect('slide_down',{duration:2.5}) }); return false;"><strong><em>Bookmark to:</em></strong></a>
<br />
<div class="d71" style="overflow:hidden">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.dzone.com/links/add.html?description=Java+Memory+Management+Improvement+Proposal&amp;url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;DZone"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/dzone.png" title="Add to&nbsp;DZone" alt="Add to&nbsp;DZone" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.facebook.com/sharer.php?u=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F" rel="nofollow" title="Add to&nbsp;Facebook"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/facebook.png" title="Add to&nbsp;Facebook" alt="Add to&nbsp;Facebook" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;Google Bookmarks"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/google.png" title="Add to&nbsp;Google Bookmarks" alt="Add to&nbsp;Google Bookmarks" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;Slashdot"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/slashdot.png" title="Add to&nbsp;Slashdot" alt="Add to&nbsp;Slashdot" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;Stumble Upon"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/stumbleupon.png" title="Add to&nbsp;Stumble Upon" alt="Add to&nbsp;Stumble Upon" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.squidoo.com/lensmaster/bookmark?http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F" rel="nofollow" title="Add to&nbsp;Squidoo"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/squidoo.png" title="Add to&nbsp;Squidoo" alt="Add to&nbsp;Squidoo" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.spurl.net/spurl.php?url=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F&amp;title=Java+Memory+Management+Improvement+Proposal" rel="nofollow" title="Add to&nbsp;Spurl"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/spurl.png" title="Add to&nbsp;Spurl" alt="Add to&nbsp;Spurl" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.technorati.com/faves?add=http%3A%2F%2Fwww.innovationontherun.com%2Fjava-memory-management-improvement-proposal%2F" rel="nofollow" title="Add to&nbsp;Technorati"><img class="social_img" src="http://www.innovationontherun.com/wp-content/plugins/social-bookmarks/images/technorati.png" title="Add to&nbsp;Technorati" alt="Add to&nbsp;Technorati" /></a>
<br />
<a style="font-size:90%;text-align: right; " title="Click me to hide the sites." href="#" onclick="$$('div.d71').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); return false;">Hide Sites</a>
</div>
</div>
<!-- Social Bookmarks END -->
<script type="text/javascript">$$('div.d71').each( function(e) { e.visualEffect('slide_up',{duration:0.5}) }); </script>]]></content:encoded>
			<wfw:commentRss>http://www.innovationontherun.com/java-memory-management-improvement-proposal/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>
