<?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: Saving memory in Ruby on Rails with fork() and copy-on-write</title>
	<atom:link href="http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/</link>
	<description>Ecchi nanowa ikenai to omoimasu</description>
	<lastBuildDate>Fri, 09 Apr 2010 11:42:43 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: bandsxbands</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-10046</link>
		<dc:creator>bandsxbands</dc:creator>
		<pubDate>Wed, 03 Mar 2010 08:48:01 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-10046</guid>
		<description>Virtual Memory sure is becoming cheaper and cheaper and cheaper. I&#039;m curious as to when we will eventually reach the ratio of 1c to 1 Gigabyte.I&#039;m quietly waiting for the day when I will &lt;i&gt;finally&lt;/i&gt; be able to afford a 20 TB hard disk, hahaha. But for now I guess I will be satisfied with having a 32 GB Micro SD Card in my R4i.(Submitted from FFBrows for R4i Nintendo DS.)</description>
		<content:encoded><![CDATA[<p>Virtual Memory sure is becoming cheaper and cheaper and cheaper. I&#8217;m curious as to when we will eventually reach the ratio of 1c to 1 Gigabyte.I&#8217;m quietly waiting for the day when I will <i>finally</i> be able to afford a 20 TB hard disk, hahaha. But for now I guess I will be satisfied with having a 32 GB Micro SD Card in my R4i.(Submitted from FFBrows for R4i Nintendo DS.)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hongli</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-7463</link>
		<dc:creator>Hongli</dc:creator>
		<pubDate>Mon, 10 Dec 2007 21:35:48 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-7463</guid>
		<description>Ben Knight: Yes. Actually I&#039;ve already solved it. Please click on the &quot;Optimizing Rails&quot; category for more recent posts on this subject.

I&#039;m not sure whether JRuby will solve the problem. Java is a memory hog on its own, and Ruby on Rails is not thread-safe so RoR on JRuby will not use threads (I think).</description>
		<content:encoded><![CDATA[<p>Ben Knight: Yes. Actually I&#8217;ve already solved it. Please click on the &#8220;Optimizing Rails&#8221; category for more recent posts on this subject.</p>
<p>I&#8217;m not sure whether JRuby will solve the problem. Java is a memory hog on its own, and Ruby on Rails is not thread-safe so RoR on JRuby will not use threads (I think).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ben Knight</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-7461</link>
		<dc:creator>Ben Knight</dc:creator>
		<pubDate>Mon, 10 Dec 2007 14:28:54 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-7461</guid>
		<description>Are there any good solutions to this problem?  I&#039;m facing this problem currently.

Is JRuby a good workaround to this problem since it uses threads to service multiple HTTP requests?</description>
		<content:encoded><![CDATA[<p>Are there any good solutions to this problem?  I&#8217;m facing this problem currently.</p>
<p>Is JRuby a good workaround to this problem since it uses threads to service multiple HTTP requests?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hongli</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6794</link>
		<dc:creator>Hongli</dc:creator>
		<pubDate>Fri, 12 Oct 2007 09:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6794</guid>
		<description>Yes, I discovered that later. That&#039;s what my garbage collector blog posts are devoted on.</description>
		<content:encoded><![CDATA[<p>Yes, I discovered that later. That&#8217;s what my garbage collector blog posts are devoted on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dan42</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6791</link>
		<dc:creator>Dan42</dc:creator>
		<pubDate>Fri, 12 Oct 2007 01:19:18 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6791</guid>
		<description>I think there&#039;s one little problem with this picture: when the garbage collector runs, ALL memory pages are touched. In other words, copy-on-write offers memory savings only until the first run of the garbage collector. For long-running processes, there will be no memory savings (well, except for static libraries maybe). Forking does help to reduce startup time but IMHO your memory measurements are flawed.</description>
		<content:encoded><![CDATA[<p>I think there&#8217;s one little problem with this picture: when the garbage collector runs, ALL memory pages are touched. In other words, copy-on-write offers memory savings only until the first run of the garbage collector. For long-running processes, there will be no memory savings (well, except for static libraries maybe). Forking does help to reduce startup time but IMHO your memory measurements are flawed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Matt</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6771</link>
		<dc:creator>Matt</dc:creator>
		<pubDate>Wed, 19 Sep 2007 18:36:42 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6771</guid>
		<description>Something like the following will prevent AR in the child from sharing the connection with the parent, so that one of the processes closing it doesn&#039;t break the other.

    dbconfig = ActiveRecord::Base.remove_connection
    pid = fork do
      begin
        ActiveRecord::Base.establish_connection(dbconfig)
      ensure
       ActiveRecord::Base.remove_connection
      end
    end
    ActiveRecord::Base.establish_connection(dbconfig)</description>
		<content:encoded><![CDATA[<p>Something like the following will prevent AR in the child from sharing the connection with the parent, so that one of the processes closing it doesn&#8217;t break the other.</p>
<p>    dbconfig = ActiveRecord::Base.remove_connection<br />
    pid = fork do<br />
      begin<br />
        ActiveRecord::Base.establish_connection(dbconfig)<br />
      ensure<br />
       ActiveRecord::Base.remove_connection<br />
      end<br />
    end<br />
    ActiveRecord::Base.establish_connection(dbconfig)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hongli</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6760</link>
		<dc:creator>Hongli</dc:creator>
		<pubDate>Thu, 06 Sep 2007 13:50:20 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6760</guid>
		<description>Eh, mr &quot;asdf&quot;, if I&#039;m so dumb and you&#039;re so smart then why don&#039;t you teach me how to gauge memory the right way, oh great l33t master?

Secondly, why is this &quot;junk science&quot;? I posted the entire process in a verifiable way. Anybody can review the process and point out mistakes. Isn&#039;t this the entire point of the scientific method?

And why are you posting anonymously anyway? If you have constructive criticism you shouldn&#039;t have anything to fear. You do realize that you&#039;re undermining your credibility by posting anonymously, don&#039;t you?</description>
		<content:encoded><![CDATA[<p>Eh, mr &#8220;asdf&#8221;, if I&#8217;m so dumb and you&#8217;re so smart then why don&#8217;t you teach me how to gauge memory the right way, oh great l33t master?</p>
<p>Secondly, why is this &#8220;junk science&#8221;? I posted the entire process in a verifiable way. Anybody can review the process and point out mistakes. Isn&#8217;t this the entire point of the scientific method?</p>
<p>And why are you posting anonymously anyway? If you have constructive criticism you shouldn&#8217;t have anything to fear. You do realize that you&#8217;re undermining your credibility by posting anonymously, don&#8217;t you?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: asdf</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6758</link>
		<dc:creator>asdf</dc:creator>
		<pubDate>Thu, 06 Sep 2007 00:11:10 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6758</guid>
		<description>Linux NOOB,

try using ps to gauge your mongrel memory consumption...using free..what a joke...stupid linux NOOB

Your blog page is 100% junk science...way to add to the lies and misinformation</description>
		<content:encoded><![CDATA[<p>Linux NOOB,</p>
<p>try using ps to gauge your mongrel memory consumption&#8230;using free..what a joke&#8230;stupid linux NOOB</p>
<p>Your blog page is 100% junk science&#8230;way to add to the lies and misinformation</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: 赖洪礼的 blog &#187; Saving memory in Ruby on Rails with fork() - failed</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6554</link>
		<dc:creator>赖洪礼的 blog &#187; Saving memory in Ruby on Rails with fork() - failed</dc:creator>
		<pubDate>Mon, 23 Jul 2007 09:50:46 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6554</guid>
		<description>[...] been working on mongrel_light_cluster, an extension for mongrel_cluster which automatically uses copy-on-write semantics to save memory in Ruby on Rails applications. The initial measurements were exciting - one can [...]</description>
		<content:encoded><![CDATA[<p>[...] been working on mongrel_light_cluster, an extension for mongrel_cluster which automatically uses copy-on-write semantics to save memory in Ruby on Rails applications. The initial measurements were exciting &#8211; one can [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Florian Frank</title>
		<link>http://izumi.plan99.net/blog/index.php/2007/04/05/saving-memory-in-ruby-on-rails/comment-page-1/#comment-6501</link>
		<dc:creator>Florian Frank</dc:creator>
		<pubDate>Thu, 24 May 2007 10:11:06 +0000</pubDate>
		<guid isPermaLink="false">http://izumi.plan99.net/blog/?p=19#comment-6501</guid>
		<description>@Hongli:
&gt; This suggests that the problem is likely to be caused by an exit handler - when the child process calls exit the exit handler does things which screws up the database connection. Ruby doesn’t seem to have a way to call _exit() to bypass exit handlers.

Actually you can bypass exit handlers in Ruby, if you call the exit! (with bang) method.</description>
		<content:encoded><![CDATA[<p>@Hongli:<br />
&gt; This suggests that the problem is likely to be caused by an exit handler &#8211; when the child process calls exit the exit handler does things which screws up the database connection. Ruby doesn’t seem to have a way to call _exit() to bypass exit handlers.</p>
<p>Actually you can bypass exit handlers in Ruby, if you call the exit! (with bang) method.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
