<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Musings of a Trained Monkey: Tag rails</title>
    <link>http://www.stevelongdo.com/articles/tag/rails</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <item>
      <title>ActiveMessaging is still alive...</title>
      <description>&lt;p&gt;I am happy to see that ActiveMessaging (a13g&amp;lt;-corny) is returning to life.  It was announced with a bit of fanfare by &lt;a href="http://www.jroller.com/page/obie?entry=activemessaging_coming_soon"&gt;Obie in early 2006&lt;/a&gt; and then disappeared.&lt;br /&gt;&lt;br /&gt;  &lt;a href="http://jutopia.tirsen.com/"&gt;Jon Tirsen&lt;/a&gt; sent out some invites for a new &lt;a href="http://groups.google.com/group/activemessaging-discuss"&gt;Google Group&lt;/a&gt; and introduced &lt;a href="http://www.beginsinwonder.com"&gt;Andrew Kuklewicz&lt;/a&gt; as the new maintainer of the project.  I think this will become &lt;em&gt;the&lt;/em&gt; premier way for &lt;a href="http://rubyonrails.org"&gt;RoR&lt;/a&gt; apps to interact with Java backends in 2007.  Take a look at &lt;a href="http://code.google.com/p/activemessaging"&gt;the code&lt;/a&gt; and see how you can contribute!&lt;/p&gt;</description>
      <pubDate>Thu, 04 Jan 2007 20:49:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:335a8746-af13-42f4-bc61-8d1308798f54</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2007/01/04/activemessaging-is-still-alive</link>
      <category>ruby</category>
      <category>activemessaging</category>
      <category>rails</category>
      <category>jms</category>
    </item>
    <item>
      <title>RubyGems and Memory, again...</title>
      <description>&lt;p&gt;I&amp;#8217;ve been toying with switching over to &lt;a href=":http://mephistoblog.com"&gt;Mephisto&lt;/a&gt; and spending some extra time studying memory consumption, which is quite a bit higher in &lt;a href=":http://mephistoblog.com"&gt;Mephisto&lt;/a&gt; than &lt;a href=":http://typosphere.org"&gt;Typo&lt;/a&gt;.  Using the latest svn trunk of &lt;a href=":http://rubygems.org"&gt;RubyGems&lt;/a&gt; (r1100), the bug with multiple &lt;strong&gt;Gem::GemPathSearcher&lt;/strong&gt; instances being created has been fixed, but now there is a different problem.  Multiple &lt;strong&gt;Gem::SourceIndex&lt;/strong&gt; instances are created.  I can see where this might be needed with the recent &lt;em&gt;&amp;#8220;incremental updates to the gem list&amp;#8221;&lt;/em&gt; change that went into &lt;a href=":http://rubygems.org"&gt;RubyGems&lt;/a&gt;, it doesn&amp;#8217;t make sense to have these hanging around in memory for the lifetime of a &lt;a href=":http://rubyonrails.org"&gt;Rails&lt;/a&gt; application.&lt;/p&gt;


	&lt;p&gt;I took the same approach to a fix as last time, adding the &lt;code&gt;require&lt;/code&gt; and &lt;code&gt;include&lt;/code&gt; for &lt;strong&gt;Singleton&lt;/strong&gt; into the &lt;em&gt;SourceIndex.rb&lt;/em&gt; class.  This worked fine for loading up &lt;a href=":http://mephistoblog.com"&gt;Mephisto&lt;/a&gt; and indeed reduced the memory use substantially.&lt;/p&gt;


	&lt;table&gt;
		&lt;tr&gt;
			&lt;td&gt;r1100 without &lt;strong&gt;Singleton&lt;/strong&gt;  &lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;strong&gt;Gem::SourceIndex x2(1062363)&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
		&lt;tr&gt;
			&lt;td&gt;r1100 &lt;ins&gt;with&lt;/ins&gt; &lt;strong&gt;Singleton&lt;/strong&gt; &lt;/td&gt;
			&lt;td&gt; &amp;#8211; &lt;strong&gt;Gem::SourceIndex x1(97621)&lt;/strong&gt;&lt;/td&gt;
		&lt;/tr&gt;
	&lt;/table&gt;




	&lt;p&gt;&lt;br /&gt;
I haven&amp;#8217;t checked to see how this change impairs &lt;a href=":http://rubygems.org"&gt;RubyGems&lt;/a&gt; for getting new gems, update, etc. but it seems like there needs to be a different amount of information loaded for bootstrapping the &lt;code&gt;gem&lt;/code&gt; command, versus a running &lt;a href="http://ruby-lang.org"&gt;Ruby&lt;/a&gt; or &lt;a href=":http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; application.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Does the running application &lt;strong&gt;really&lt;/strong&gt; have a need to know the complete dependency hierarchy for &lt;strong&gt;all&lt;/strong&gt; of the installed gems on a system?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;ul&gt;
	&lt;li&gt;Even if your application did, would you want that information stored into memory from startup to shutdown?&lt;/li&gt;
	&lt;/ul&gt;</description>
      <pubDate>Tue, 21 Nov 2006 22:47:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:25fbd8e6-7d57-4719-975d-1a4c0c19e050</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/11/21/rubygems-and-memory-again</link>
      <category>rubygems</category>
      <category>rails</category>
      <category>memory</category>
    </item>
    <item>
      <title>Java, Spring and Why I Haven't Posted Lately...</title>
      <description>Things have been busy on the work side of my activities lately.  Work is currently revolving around Java and using &lt;a href="http://springframework.org"&gt;Spring&lt;/a&gt; MVC.  Since I have primarily focused on Ruby and &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; information on my blog, I've been reluctant to blog about where my head is at in the Java space. If someone is interested, leave a comment and I'll see what I can come up with.&lt;br /&gt;&lt;br /&gt;
Which isn't to say I am not tracking recent developments in the &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; community, just that I haven't had time to analyze their impact and vomit forth a blog entry or two :-)&lt;br /&gt;&lt;br /&gt;
Okay, one little morsel of my experience with &lt;a href="http://springframework.org"&gt;Spring&lt;/a&gt; relates to one of the core tenets of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt;: &lt;a href="http://static.springframework.org/spring/docs/2.0.x/reference/mvc.html#mvc-coc"&gt;"Convention over configuration"&lt;/a&gt;. &lt;br /&gt;It finally found a way into a Java web development framework!</description>
      <pubDate>Fri, 06 Oct 2006 03:37:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ea5f146d-7a7b-4385-8550-dd94f56a73ad</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/10/06/java-spring-and-why-i-havent-posted-lately</link>
      <category>rails</category>
      <category>spring</category>
      <category>java</category>
    </item>
    <item>
      <title>Unspace.ca: The Agony, The Ecstasy</title>
      <description>&lt;a href="http://unspace.ca"&gt;Unspace.ca&lt;/a&gt; has released some interesting code to the open source community this year.  September 13th, 2006 has them unleashing the first Rails plugin code that will make you want to gouge out your own eyes upon viewing the example code.  &lt;br/&gt;&lt;br/&gt;&lt;b&gt;"The Agony"&lt;/b&gt; in the title of this post relates to the release of the &lt;a href="http://unspace.ca/discover/haml/"&gt;HAML&lt;/a&gt; plugin.  &lt;i&gt;(Somewhat irresponsibly linked to by me, seriously please don't gouge out your eyes)&lt;/i&gt;  Why, oh why, did they decide to combine white space sensitivity with HTML? Is there a disgruntled postal worker/Python  programmer working there or what? Perhaps it is used in some sort of hazing ritual for their new employees.&lt;br /&gt;&lt;br /&gt;
On the other hand we have &lt;b&gt;"The Ecstasy"&lt;/b&gt;, the very useful &lt;a href="http://unspace.ca/discover/datagrid"&gt;Datagrid&lt;/a&gt;.  This is an excellent and worthy open source release.  It combines functionality with a great example of use.  Granted it would be nice if it was packaged as a Rails plugin, but back in March adding routes in a plugin would have been difficult. &lt;br /&gt;&lt;br /&gt;Anyway, I am looking forward to see what &lt;a href="http://unspace.ca"&gt;Unspace.ca&lt;/a&gt; will do next, hopefully they will serve up more of &lt;b&gt;"The Ecstasy"&lt;/b&gt; </description>
      <pubDate>Thu, 14 Sep 2006 04:05:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:1c8cae62-7016-4091-8d04-5f9fc377a121</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/09/14/unspace-ca-the-agony-the-ecstasy</link>
      <category>plugin</category>
      <category>rails</category>
    </item>
    <item>
      <title>Loose Ends</title>
      <description>Some loose ends will be tied up here soon.  Here is a quick list of things that I intend to post more about soon.  Suggestions/requests will be taken from comments as well :-)
&lt;ul&gt;
&lt;li&gt;AJAX-ed &lt;a href="http://openrico.org"&gt;OpenRico&lt;/a&gt; Accordion widget&lt;/li&gt;
&lt;li&gt;$LOAD_PATH and Revealing some &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; Magic Tricks&lt;/li&gt;
&lt;li&gt;&lt;a href="http://www.typosphere.org"&gt;Edge Typo's&lt;/a&gt; New Pluggable Sidebars&lt;/li&gt;
&lt;li&gt;&lt;strike&gt;Installing &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; on &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt;&lt;/strike&gt; &lt;a href="http://www.stevelongdo.com/articles/2006/08/31/installing-a-patched-rubygems-on-textdrive"&gt;Done!&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Further Exploring the Limits on &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt;:&lt;/li&gt;
&lt;ul&gt;
&lt;li&gt;
[rhesus@davie ~]$ &lt;b&gt;ulimit -a&lt;/b&gt;&lt;br /&gt;
core file size          (blocks, -c) 0&lt;br /&gt;
data seg size           (kbytes, -d) 40960&lt;br /&gt;
file size               (blocks, -f) unlimited&lt;br /&gt;
max locked memory       (kbytes, -l) 32768&lt;br /&gt;
&lt;b&gt;max memory size         (kbytes, -m) 49152&lt;/b&gt;&lt;br /&gt;
open files                      (-n) 240&lt;br /&gt;
pipe size            (512 bytes, -p) 1&lt;br /&gt;
stack size              (kbytes, -s) 16384&lt;br /&gt;
cpu time               (seconds, -t) 1200&lt;br /&gt;
max user processes              (-u) 20&lt;br /&gt;
virtual memory          (kbytes, -v) 81920&lt;br /&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt; </description>
      <pubDate>Fri, 25 Aug 2006 04:07:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:a187992a-d7d1-4fc5-abcb-2bb7bbafd19e</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/25/loose-ends</link>
      <category>todo</category>
      <category>ajax</category>
      <category>textdrive</category>
      <category>rails</category>
    </item>
    <item>
      <title>RubyGems memory reduction...</title>
      <description>I did gain some insight into the number of &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; instances through my efforts.  They correspond nicely for each piece of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; that is loaded; ActionMailer, ActiveSupport, ActiveRecord, ActionPack, ActionWebService and Railties. Each of these has the &lt;code&gt;require 'rubygems'&lt;/code&gt; statement in it.  I believe this is why I was seeing multiple instances of &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt;. &lt;br /&gt;
&lt;br /&gt;
As explained before instances of these take up an amount of memory proportional to the number of gems/gem versions in a repository.  Making &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; a Singleton of course, resolves more than one instance being loaded into memory.  This has been submitted as a patch to &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; &lt;a href="http://rubyforge.org/tracker/?func=detail&amp;atid=577&amp;aid=5394&amp;group_id=126"&gt;[ticket #5394]&lt;/a&gt;.
&lt;br /&gt;
&lt;br /&gt;
Installing a patched version of &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; 0.9.0 on &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt; to demonstrate the fix with &lt;a href="http://ww.typosphere.org"&gt;Typo&lt;/a&gt; proved to be the most frustrating part.  I will write a follow up posting on exactly how to do this in the near future.  Hopefully they will release an updated &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; soon!
&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.planetargon.com/"&gt;Shared&lt;/a&gt; &lt;a href="http://www.dreamhost.com"&gt;hosts&lt;/a&gt; will definitely want to patch their &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; installs to reduce their memory consumption across all of their &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; users.  &lt;a href="http://www.textdrive.com"&gt;TextDrive&lt;/a&gt; in particular should buy me a present or something :-) 
&lt;br /&gt;
&lt;br /&gt;
I've learned a great deal about the &lt;a href="http://rubylang.org"&gt;Ruby&lt;/a&gt; memory ecosystem by digging into this issue with &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt;.  I got help from some folks on the &lt;a href="http://www.ruby-forum.com/forum/3"&gt;Rails mailing list&lt;/a&gt; but far and away I want to thank &lt;b&gt;Stef Telford&lt;/b&gt; for the help.  Mad props to you for putting up with all of my questions and ramblings!
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Finally some numbers:&lt;/b&gt;
&lt;br /&gt;
Gem::Dependency x330(57415)
&lt;br /&gt;
Gem::Version::Requirement x693(61939)
&lt;br /&gt;
Gem::SourceIndex x1(1632488)
&lt;br /&gt;&lt;b&gt;Gem::GemPathSearcher2&amp;nbsp;x1(1647806)&lt;/b&gt;&amp;nbsp;&lt;b&gt;&lt;--&lt;/b&gt;&amp;nbsp;&lt;b&gt;Gem::GemPathSearcher&amp;nbsp;x5(7901012)&lt;/b&gt;&lt;br /&gt;
Hash x1219(1789928)
&lt;br /&gt;
Gem::Specification x362(1795089)
&lt;br /&gt;
String x113992(3876455)
&lt;br /&gt;
Array x7415(5080185)
&lt;br /&gt;
&lt;b&gt;TOTAL&amp;nbsp;==&amp;nbsp;16967273&lt;/b&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;b&gt;&lt;--&lt;/b&gt;&amp;nbsp;&lt;b&gt;TOTAL&amp;nbsp;==&amp;nbsp;28496875&lt;/b&gt;
&lt;br /&gt;&lt;br /&gt;
Update:  These memory numbers are lower than actual process size.  They vary by number of Modules loaded as well as Objects counts.  Not all Objects and Modules can be evaluated for memory size.  The new routing code in the latest version of Rails may also account for some of the difference as well.  So grain of salt...</description>
      <pubDate>Sat, 12 Aug 2006 07:00:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:00dbf8e8-5fa9-43f2-9450-d3e6b7e52444</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/12/rubygems-memory-reduction</link>
      <category>typo</category>
      <category>rails</category>
      <category>memory</category>
      <category>rubygems</category>
      <category>profiling</category>
    </item>
    <item>
      <title>RubyGems: Single/Multi-tons and memorysize</title>
      <description>There is a line in the &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; source code, &lt;code&gt;@gempath_searcher ||= Gem::GemPathSearcher.new&lt;/code&gt;, from custom_require.rb that seeks to make &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; a Singleton class. For some reason this isn't sufficient as I have seen as many as five instances of it existing in the same thread during profiling of &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt;.  I am not sure why more than one gets generated. It may relate to &lt;a href="http://www.rubyonraiils.org"&gt;Rails&lt;/a&gt; aliasing the &lt;code&gt;Kernel.require&lt;/code&gt; method after &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; has in custom_require.rb.
&lt;br/&gt;&lt;br/&gt;
Review of the source makes me understand why a &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; instance can be so large, it holds the gem specifications for every gem and version on the load path.  Running locally this is not a big deal, as you probably don't have a lot of gems and their versions installed.  On a shared host though there are tons of gems and versions of gems installed (&lt;b&gt;350+&lt;/b&gt; on my TextDrive server!).
&lt;br/&gt;&lt;br/&gt;
A permanent solution to fix &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; to truly be a Singleton class would probably be something as simple as checking &lt;code&gt;Object.const_defined?(:GemPathSearcher)&lt;/code&gt; to see if the class is already in memory.
&lt;br/&gt;&lt;br/&gt;
A quick alternative would be restricting the gem library path to a gem repository other than the shared host's repository.  This can be done by exporting the &lt;b&gt;GEM_HOME&lt;/b&gt; variable in your shell.  There is also a &lt;b&gt;GEM_PATH&lt;/b&gt; variable that can be used to support multiple repositories.  Examples of how to work with these variables can be found on the &lt;a href="http://wiki.rubyonrails.org/rails/pages/HowToUseMultipleGemRepositories"&gt;Rails wiki&lt;/a&gt;.  It should be possible to make a repository containing just the gems your app needs and nothing else.  This will reduce the memory footprint of &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; quite a bit, no matter how many instances of them there might be!
 &lt;br /&gt;&lt;br /&gt;
Obviously I am still learning the implications of &lt;a href="http://rubygems.org"&gt;RubyGems&lt;/a&gt; working together with &lt;a href="http://rubyonrails.org"&gt;Rails&lt;/a&gt; apps.  I apologize for you the reader being dragged along on my quest to learn.  Anyone wishing to bring this quest to a quick end just tell me how it ends.
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Update:&lt;/strong&gt; I will continue my research until we arrive at the truth.  I still have some other &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; optimizing techniques to apply.  My hope is using something like the gemconfigure file described &lt;a href="http://www.rubygems.org/read/chapter/4#page73"&gt;in the documentation&lt;/a&gt; will be the difference between the Whole Milk Memory and Skim Milk Memory.  Also I will reformat the code in the post to be pretty tomorrow.  need to add some stuff to scribbish to accomplish this and I want to go to bed now...</description>
      <pubDate>Wed, 09 Aug 2006 03:41:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:3df63391-1cf6-4237-b987-aa0823be01ac</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/09/rubygems-single-multi-tons-and-memorysize</link>
      <category>rubygems</category>
      <category>rails</category>
      <category>typo</category>
      <category>memory</category>
      <category>profiling</category>
      <category>howto</category>
    </item>
    <item>
      <title>RubyGems dependency management and memory use...</title>
      <description>I've been looking into the nebulous matter of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; memory management &lt;a href="http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction"&gt;lately&lt;/a&gt;, using &lt;a href="http://typosphere.org"&gt;Typo4&lt;/a&gt; as my model app.  In my research thus far I have noticed that several of the highest memory using items are from the &lt;a href="http://www.rubygems.org/"&gt;RubyGems&lt;/a&gt; library.  Particularly the &lt;b&gt;Gem::GemPathSearcher&lt;/b&gt; object.  After running a few days I have picked up five instances of it taking up nearly 8MB of RAM which is odd because the first time I profiled it there were &lt;b&gt;only&lt;/b&gt; four of them.  I am not sure why &lt;a href="http://www.rubygems.org/"&gt;RubyGems&lt;/a&gt; needs to be in memory after the app initially loads, especially the ~1.5MB &lt;b&gt;SourceIndex&lt;/b&gt; and the 352 &lt;b&gt;Gem::Specification&lt;/b&gt; objects for another ~1.6MB.  Seems like wiring of any dependencies could be done once at start up.  I am not sure if this relates specifically to how &lt;a href="http://typosphere.org"&gt;Typo&lt;/a&gt; uses &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; or if all &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; apps incur the memory overhead penalty for &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt;. If any one with knoweldge of the internal functioning of &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; would take the time to educate me on this it would be much appreciated.  Also if someone could explain why &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; pops up at all since all &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; dependencies are deployed into the vendor folder.&lt;br /&gt;
&lt;br /&gt;Another one to watch is the slow accumulation of &lt;b&gt;ActiveRecord::ConnectionAdpaters::MysqlColumn&lt;/b&gt;, up to 217 instances in memory.  Not a particularly large memory hit, but they have steadily grown in number over the last few days.  i may swith over to my &lt;a href="http://www.postgresql.org/"&gt;Postgres&lt;/a&gt; database and see if the same thing happens with its connecton adapter.&lt;br /&gt;&lt;br /&gt;
Finally the allocation of &lt;b&gt;Array&lt;/b&gt; objects is interesting.  The number of instances in use has gone down by roughly -2000 instances but the memory use of the remaining &lt;b&gt;Arrays&lt;/b&gt; has gone up by about 2MB.  I need to explode these &lt;b&gt;Arrays&lt;/b&gt; and see what they hold and why they stick around so long.  Partial output of profiling included below:
&lt;br /&gt;
&lt;br /&gt;Class x852(21194)
&lt;br/ &gt;&lt;b&gt;Gem::Version x709(24981)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;ActiveRecord::ConnectionAdapters::MysqlColumn x217(35410)&lt;/b&gt;
&lt;br/ &gt;Regexp x1343(52312)
&lt;br/ &gt;&lt;b&gt;Gem::Dependency x309(53743)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;Gem::Version::Requirement x662(59168)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;Gem::SourceIndex x1(1563056)&lt;/b&gt;
&lt;br/ &gt;&lt;b&gt;Gem::Specification x352(1714117)&lt;/b&gt;
&lt;br/ &gt;Hash x1257(1858255)
&lt;br/ &gt;String x117204(3869923)
&lt;br/ &gt;&lt;b&gt;Gem::GemPathSearcher x5(7901012)&lt;/b&gt;
&lt;br/ &gt;Array x6093(11102839)&lt;/b&gt;
&lt;br /&gt;
&lt;b&gt;TOTAL == 28496875&lt;/b&gt;
&lt;br /&gt;&lt;br /&gt;
Please do share your experiences with &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; or &lt;a href="http://www.rubygems.org"&gt;RubyGems&lt;/a&gt; memory use in the comments.</description>
      <pubDate>Tue, 08 Aug 2006 06:30:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:e9ec453d-bde3-40e3-b93d-a56eee868d15</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/08/rubygems-dependency-management-and-memory-use</link>
      <category>rails</category>
      <category>rubygems</category>
      <category>typo</category>
      <category>memory</category>
      <category>stats</category>
    </item>
    <item>
      <title>Typo 4.0 and memory reduction...</title>
      <description>Have you upgraded to the latest &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; release only to find that it hits the per process memory limit on your host?  It happened to me. &lt;br /&gt;&lt;br /&gt;Here is how I went about reducing the memory footprint of &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt;:&lt;ul&gt;
&lt;li&gt;Removed sidbars that aren't used from the installation.&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;Amazon through XBox.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;Removed unused requires from environment.rb&lt;/li&gt;
&lt;ul&gt;&lt;li&gt;In particlular aggregation classes for the Sidebars that were removed.&lt;/li&gt;&lt;/ul&gt;
&lt;li&gt;Make sure to not load any unnecessary parts of &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; (i.e. ActiveWebService)&lt;b&gt; That's right I use the admin screen to post!&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;Most importantly deleted the sparklines_textfilter.&lt;/li&gt;
&lt;/ul&gt; 
That last one makes a huge difference in the memory use of &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt;.  It removes the need to load RMagick saving around ~8MB from your process size.  In fact these changes have brought &lt;a href="http://www.typosphere.org"&gt;Typo&lt;/a&gt; down to about 33MB in memory.  Since the average &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; app uses 30MB this isn't too bad, however memory consumption slowly creeps up over a period of days and hits the limit.  Seemingly a memory leak.  I will be digging into this issue as time allows, but work is keeping me busy.&lt;br /&gt;&lt;br /&gt;
I will eventually be using a diferent theme but I switched to this one while checking out memory use and haven't spent enough time on my new one yet.</description>
      <pubDate>Fri, 04 Aug 2006 22:56:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:14af913d-7393-419f-ad9f-bbcbcea81d4e</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction</link>
      <category>typo</category>
      <category>rails</category>
      <category>memory</category>
    </item>
    <item>
      <title>RailsConf2006 DHH keynote...</title>
      <description>&lt;a href="http://www.nextangle.com"&gt;David Heinemeier Hansson's&lt;/a&gt; keynote was rather, um CRUD-dy  :-)&lt;br /&gt;&lt;br/&gt;
It mainly focused on the importance of modelling the application domain as well as the relationships between the models, at the correct level of abstraction/encapsulation.  This of course is nothing new to anyone who has been doing software development for a while.&lt;br/&gt;&lt;br/&gt;  The new part comes in with using all of the HTTP "verbs" (POST,GET,PUT,DESTROY) in &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt; as a default convention. So for CRUD; Create=POST, Read=GET, Update=PUT, and Delete=DESTROY. Using this convention it is possible to build a higher level abstraction on top, tentatively called ActiveResource.  He also discussed the use of &lt;a href="http://api.rubyonrails.com/classes/ActionController/MimeResponds/InstanceMethods.html"&gt;respond_to&lt;/a&gt;, the HTTP Accept Headers, and even extensions to handle multiple input and output types from a single controller.  So the same code that handles a HTML page could be reused as a webservice for example, or for returning a JavaScript representation.  Definitely an area to keep an eye on.&lt;br/&gt;&lt;br/&gt;All in all he is an excellent presenter. He definitely has a charisma that holds your attention in person.  Outside of the material in his presentation he explained some of the reasons why things are the way they are in &lt;a href="http://www.rubyonrails.org"&gt;Rails&lt;/a&gt;.  In particular the intentionally lackluster support for composite primary keys. Hearing this in person is much more effective than reading about it on a mailing list.</description>
      <pubDate>Mon, 26 Jun 2006 18:02:00 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:85e33357-0532-45b6-9791-c2308a48c73b</guid>
      <author>Steve Longdo</author>
      <link>http://www.stevelongdo.com/articles/2006/06/26/railsconf2006-dhh-keynote</link>
      <category>railsconf2006</category>
      <category>rails</category>
      <category>dhh</category>
    </item>
  </channel>
</rss>
