<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: LBQ + GC = Slow</title>
	<atom:link href="http://tech.puredanger.com/index.php/2009/02/11/linkedblockingqueue-garbagecollection/feed/" rel="self" type="application/rss+xml" />
	<link>http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/</link>
	<description>Alex Miller&#039;s technical blog</description>
	<lastBuildDate>Mon, 06 Feb 2012 19:39:50 -0800</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
	<item>
		<title>By: Amit</title>
		<link>http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/comment-page-1/#comment-273864</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Fri, 21 Jan 2011 07:03:05 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/#comment-273864</guid>
		<description>Good read but I found that this issue is fixed in JDK 1.6 (atleast for update 23) 

private E dequeue() {
        // assert takeLock.isHeldByCurrentThread();
        Node h = head;
        Node first = h.next;
        h.next = h; // help GC
        head = first;
        E x = first.item;
        first.item = null;
        return x;
    }</description>
		<content:encoded><![CDATA[<p>Good read but I found that this issue is fixed in JDK 1.6 (atleast for update 23) </p>
<p>private E dequeue() {<br />
        // assert takeLock.isHeldByCurrentThread();<br />
        Node h = head;<br />
        Node first = h.next;<br />
        h.next = h; // help GC<br />
        head = first;<br />
        E x = first.item;<br />
        first.item = null;<br />
        return x;<br />
    }</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ryan Eccles</title>
		<link>http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/comment-page-1/#comment-255884</link>
		<dc:creator>Ryan Eccles</dc:creator>
		<pubDate>Wed, 13 Oct 2010 20:57:04 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/#comment-255884</guid>
		<description>I&#039;ve heard Tony Printezis refer to this promotion problem as nepotism.</description>
		<content:encoded><![CDATA[<p>I&#8217;ve heard Tony Printezis refer to this promotion problem as nepotism.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex</title>
		<link>http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/comment-page-1/#comment-164100</link>
		<dc:creator>Alex</dc:creator>
		<pubDate>Thu, 14 May 2009 02:32:39 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/#comment-164100</guid>
		<description>I certainly am not a G1 guru so I&#039;m just guessing here.  But I think the problem is references across generations.  In G1, instead of 2-3 generations, there are many many more.  So, the problem of bogus references across generations is that much more likely and (incorrectly) prevents garbage from being reclaimed across generations.</description>
		<content:encoded><![CDATA[<p>I certainly am not a G1 guru so I&#8217;m just guessing here.  But I think the problem is references across generations.  In G1, instead of 2-3 generations, there are many many more.  So, the problem of bogus references across generations is that much more likely and (incorrectly) prevents garbage from being reclaimed across generations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Vince</title>
		<link>http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/comment-page-1/#comment-164095</link>
		<dc:creator>Vince</dc:creator>
		<pubDate>Thu, 14 May 2009 02:00:29 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/#comment-164095</guid>
		<description>Can someone please explain why this might be worse with G1?  

From what I understand, G1 marks the whole stack each collection, so shouldn&#039;t it see that everything is dead right off the bat?  I thought the problem was that the dead nodes in the tenured generation were keeping everything alive even in the new gen, at least until you do an expensive full (compacting?) gc?

Maybe the bug is over my head and I&#039;m missing it...</description>
		<content:encoded><![CDATA[<p>Can someone please explain why this might be worse with G1?  </p>
<p>From what I understand, G1 marks the whole stack each collection, so shouldn&#8217;t it see that everything is dead right off the bat?  I thought the problem was that the dead nodes in the tenured generation were keeping everything alive even in the new gen, at least until you do an expensive full (compacting?) gc?</p>
<p>Maybe the bug is over my head and I&#8217;m missing it&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Peter Jodeleit</title>
		<link>http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/comment-page-1/#comment-149174</link>
		<dc:creator>Peter Jodeleit</dc:creator>
		<pubDate>Wed, 04 Mar 2009 16:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://tech.puredanger.com/2009/02/11/linkedblockingqueue-garbagecollection/#comment-149174</guid>
		<description>Update to my comment: The &quot;casHead(..)&quot; method is the more suitable place to clear the next pointer.

&lt;code&gt;
    private boolean casHead(Node&lt;E&gt; cmp, Node&lt;E&gt; val) {
        return headUpdater.compareAndSet(this, cmp, val);
    }
&lt;/code&gt;

would become

&lt;code&gt;
    private boolean casHead(Node&lt;E&gt; cmp, Node&lt;E&gt; val) {
        final result = headUpdater.compareAndSet(this, cmp, val);
        if (result) h.setNext(null);
        return result;
    }
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Update to my comment: The &#8220;casHead(..)&#8221; method is the more suitable place to clear the next pointer.</p>
<p><code><br />
    private boolean casHead(Node&lt;E&gt; cmp, Node&lt;E&gt; val) {<br />
        return headUpdater.compareAndSet(this, cmp, val);<br />
    }<br />
</code></p>
<p>would become</p>
<p><code><br />
    private boolean casHead(Node&lt;E&gt; cmp, Node&lt;E&gt; val) {<br />
        final result = headUpdater.compareAndSet(this, cmp, val);<br />
        if (result) h.setNext(null);<br />
        return result;<br />
    }<br />
</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>

