<?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: Typo 4.0 and memory reduction...</title>
    <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description></description>
    <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>"Typo 4.0 and memory reduction..." by erol</title>
      <description>Thanks for the post! I had a memory leak somewhere in ContentController#preview that knocked down my webserver. After disabling the stuff you recommended I managet to maintain my server up and running for longer than writing one article. ;-)
Will look into the preview method, maybe there is a hint why did it happen after all.</description>
      <pubDate>Fri, 01 Sep 2006 14:15:36 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:26b273d8-79d0-410a-bae4-bf764e543957</guid>
      <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction#comment-170</link>
    </item>
    <item>
      <title>"Typo 4.0 and memory reduction..." by sterling</title>
      <description>Thanks for the post. I was able to drop my memory usage by over 10 MB on Textdrive so hopefully they won't kill Typo on me any more.</description>
      <pubDate>Fri, 25 Aug 2006 19:05:45 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:6622e1b9-f4d9-4e39-b483-39bf47ef71a0</guid>
      <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction#comment-166</link>
    </item>
    <item>
      <title>"Typo 4.0 and memory reduction..." by Steve Longdo</title>
      <description>Sorry I should have posted in a bit more detail about that.  In environment.rb there is a line that is commented out showing how to ignore ActionWebService and ActionMailer.  Just copy the line and uncomment it to get rid of ActionWebService.  You could drop ActionMailer as well if you do not want email updates.
&lt;br /&gt;
&lt;b&gt;environment.rb&lt;/b&gt;&lt;br /&gt;
...&lt;br /&gt;
Rails::Initializer.run do |config|&lt;br /&gt;
  # Skip frameworks you're not going to use&lt;br /&gt;
  # config.frameworks -= [ :action_web_service, :action_mailer]&lt;br /&gt;
  &lt;b&gt;config.frameworks -= [ :action_web_service]&lt;/b&gt;&lt;br /&gt;
...&lt;br /&gt;
&lt;b&gt;# Also in the config.load.paths remove the line for actionwebservice&lt;/b&gt;&lt;br /&gt;
config.load_paths += %W(&lt;br /&gt;
    vendor/rubypants&lt;br /&gt;
    vendor/redcloth/lib&lt;br /&gt;
    vendor/bluecloth/lib&lt;br /&gt;
    vendor/flickr&lt;br /&gt;
    vendor/syntax/lib&lt;br /&gt;
    vendor/sparklines/lib&lt;br /&gt;
    vendor/uuidtools/lib&lt;br /&gt;
    vendor/jabber4r/lib&lt;br /&gt;
    vendor/rails/railties&lt;br /&gt;
    vendor/rails/railties/lib&lt;br /&gt;
    vendor/rails/actionpack/lib&lt;br /&gt;
    vendor/rails/activesupport/lib&lt;br /&gt;
    vendor/rails/activerecord/lib&lt;br /&gt;
    vendor/rails/actionmailer/lib&lt;br /&gt;
    &lt;b&gt;vendor/rails/actionwebservice/lib&lt;/b&gt;&lt;br /&gt;
  ).map {|dir| "#{RAILS_ROOT}/#{dir}"}.select { |dir| File.directory?(dir) }&lt;br /&gt;
...&lt;br /&gt;
&lt;b&gt;# This is the other chunk with the aggregation classes&lt;br /&gt;# Any that you are not using the sidebar for can safely be removed&lt;br /&gt;&lt;/b&gt;
$KCODE = 'u'&lt;br /&gt;
require_dependency 'jcode'&lt;br /&gt;
&lt;b&gt;require_dependency 'aggregations/audioscrobbler'&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;require_dependency 'aggregations/delicious'&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;require_dependency 'aggregations/tada'&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;require_dependency 'aggregations/flickr'&lt;/b&gt;&lt;br&gt;/&gt;
&lt;b&gt;require_dependency 'aggregations/fortythree'&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;require_dependency 'aggregations/magnolia'&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;require_dependency 'aggregations/upcoming'&lt;/b&gt;&lt;br /&gt;

</description>
      <pubDate>Tue, 08 Aug 2006 14:13:23 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:12c4562c-b35a-4bb5-9a24-c689c00e2854</guid>
      <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction#comment-149</link>
    </item>
    <item>
      <title>"Typo 4.0 and memory reduction..." by Ian Holsman</title>
      <description>How does one stop typo loading activewebservice?</description>
      <pubDate>Tue, 08 Aug 2006 12:59:48 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:4c1f0c1f-9341-4e3b-9b7f-84f8b7d9ed32</guid>
      <link>http://www.stevelongdo.com/articles/2006/08/04/typo-4-0-and-memory-reduction#comment-147</link>
    </item>
  </channel>
</rss>
