# Ruby memory usage

**URL:** <https://www.ruby-forum.com/t/ruby-memory-usage/167440>\
**Category:** Ruby\
**Created:** [May 7, 2009, 8:01pm UTC](https://www.ruby-forum.com/t/ruby-memory-usage/167440 "2009-05-07T20:01:10Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![moredip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@moredip](https://www.ruby-forum.com/u/moredip)\
**Post date:** [May 9, 2009, 11:20pm UTC](https://www.ruby-forum.com/t/ruby-memory-usage/167440/21 "2009-05-09T23:20:54Z")

</div>

Bill K. wrote:

> From: “Pete H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> 
> > ruby -v gives:  
> > ruby 1.8.6 (2008-06-20 patchlevel 230) [i386-linux]
> 
> patchlevel 230 was one of the bad ones. It leaks like a sieve.
> 
> See [ruby-core] thread:
> 
> [Ruby 1.8 - Bug #216] Memory leaks in 1.8.6p230 and p238  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17571](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17571)
> 
> It affected a whole range of patchlevels:  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17596](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17596)
> 
> Also, a leak of similar severity was introduced later on, starting  
> in p296 lasting at least through p355:
> 
> [ruby-core:22582] Re: [Bug #1223] Memory leak reintroduced in 1.8.6  
> branch?  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/22852](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/22852)
> 
> I’d recommend trying the recent official 1.8.6 release, p368  
> [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/332578](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/332578)
> 
> I have not personally tried p368 on my long-running servers, as  
> I had already found a stable version, p279. So I have not had a  
> need to upgrade the version. I can say that p279 is very stable  
> in its memory profile. I’m guessing the official p368 release  
> probably is too.
> 
> Hope this helps,
> 
> Bill

Great info Bill, thanks so much. I’ll try building 1.8.6-p368 and see if  
the same component exhibits different behaviour running under that  
build.

Assuming that helps, does anyone have any pointers on putting a  
non-standard ruby rpm onto a centOS box? My company use centos in  
production and I’m betting that my Ops guys will want an rpm, official  
or otherwise.

---

<div class="post-metadata">

**Author:** ![moredip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@moredip](https://www.ruby-forum.com/u/moredip)\
**Post date:** [May 11, 2009, 5:37am UTC](https://www.ruby-forum.com/t/ruby-memory-usage/167440/22 "2009-05-11T05:37:36Z")

</div>

From: “Pete H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> Assuming that helps, does anyone have any pointers on putting a  
> non-standard ruby rpm onto a centOS box? My company use centos in  
> production and I’m betting that my Ops guys will want an rpm, official  
> or otherwise.

I’ve not tried it, but checkinstall is supposedly able to capture  
whatever  
“make install” would do, and then “create a Slackware, RPM or Debian  
compatible package and install it using your distribution’s standard  
package administration utilities.”

> **[CheckInstall documentation page](https://checkinstall.izto.org/docs.php)**

Hope this helps,

Bill

---

<div class="post-metadata">

**Author:** ![moredip](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/bbce88/32.png) [@moredip](https://www.ruby-forum.com/u/moredip)\
**Post date:** [May 11, 2009, 5:28am UTC](https://www.ruby-forum.com/t/ruby-memory-usage/167440/23 "2009-05-11T05:28:27Z")

</div>

Pete H. wrote:

> Bill K. wrote:
> 
> > From: “Pete H.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
> > 
> > > ruby -v gives:  
> > > ruby 1.8.6 (2008-06-20 patchlevel 230) [i386-linux]
> > 
> > patchlevel 230 was one of the bad ones. It leaks like a sieve.
> > 
> > See [ruby-core] thread:
> > 
> > [Ruby 1.8 - Bug #216] Memory leaks in 1.8.6p230 and p238  
> > [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17571](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17571)
> > 
> > It affected a whole range of patchlevels:  
> > [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17596](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/17596)
> > 
> > Also, a leak of similar severity was introduced later on, starting  
> > in p296 lasting at least through p355:
> > 
> > [ruby-core:22582] Re: [Bug #1223] Memory leak reintroduced in 1.8.6  
> > branch?  
> > [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/22852](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-core/22852)
> > 
> > I’d recommend trying the recent official 1.8.6 release, p368  
> > [http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/332578](http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/332578)
> > 
> > I have not personally tried p368 on my long-running servers, as  
> > I had already found a stable version, p279. So I have not had a  
> > need to upgrade the version. I can say that p279 is very stable  
> > in its memory profile. I’m guessing the official p368 release  
> > probably is too.
> > 
> > Hope this helps,
> > 
> > Bill
> 
> Great info Bill, thanks so much. I’ll try building 1.8.6-p368 and see if  
> the same component exhibits different behaviour running under that  
> build.
> 
> Assuming that helps, does anyone have any pointers on putting a  
> non-standard ruby rpm onto a centOS box? My company use centos in  
> production and I’m betting that my Ops guys will want an rpm, official  
> or otherwise.

I’ve ran the same component side by side on both p230 and p368 for a few  
hours. The p368 component is holding steady at around 19MB, while the  
p230 component is up to 83MB resident, 98MB virtual. Looks like the  
culprit was indeed a leaky interpreter.

Bill, thanks so much for pointing me in such a fruitful direction.

I guess my solution will be to upgrade our production machines to the  
new p368 build.

Cheers,  
Pete

[Previous page](https://www.ruby-forum.com/t/ruby-memory-usage/167440.md?page=1)
