Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Memory Leak with Ruby 1.9.2 Rails 3.0 Beta 4

#5042

I have tried various combinations and find that by simply generating a skeleton Rails 3.0 application, and then running

siege http://localhost:3000

My ruby process would then leak a few MB every 5 minutes.

The reason I tried this is because I just converted a full blown Rails 2.3 and Ruby Enterprise 1.8.6 application over to Ruby 1.9.2 Rails 3.0 Beta 4 and find that my app is leaking memory.

This happens for both development and production environment, however happens a lot faster in development.

I do not think this is a specific Rails 3.0 problem because I am also experiencing the same with Rails 2.3.5 and Ruby 1.9.2

So it is probably how Ruby 1.9.2 is interacting with Rails.

I never had such problem with Ruby Enterprise 1.8.6.

Reported by drjoke · July 4th, 2010 @ 10:24 AM

State: stale
Milestone: 3.0.2
Assigned to: nobody
Importance: High

Activity

  1. drjoke
    drjoke

    Furture info:

    I try running the same Rails 3.0 Beta 4 application with Ruby Enterprise 1.8.7 and am not getting this same memory leak.

    So Ruby 1.9.2 seems to be the problem, since it is leaking with both Rails 2.3.5 and Rails 3 Beta 4.

    July 4th, 2010 @ 11:56 AM

  2. Rohit Arondekar
    Rohit Arondekar
    • Tag set to memory leak, ruby1.9.2
    • Importance changed from to Low

    Can you provide some more information like which version of siege, operating system and some kind of log output that shows the memory leak? Also if you ran siege with a particular configuration. It would help those trying to reproduce the problem.

    July 4th, 2010 @ 12:24 PM

  3. drjoke
    drjoke
    siege -c 1 http://localhost:3000
    

    And wait one hour. Then wait another. Then wait another.

    I use top from command prompt to view memory usage.

    With Ruby Enterprise, I do not see any change in memory usage.

    But with Ruby 1.9.2 memory keeps increasing. I have tried many Ruby 1.9.2 released in the recent months, including RC1. All had this problem.

    I have this problem on Mac 10.6.3 and also Ubuntu 8.10.

    All I have to do is

    /opt/ruby/1.9.2/rails new example
    cd example
    /opt/ruby/1.9.2/rails server
    

    then in another console I do

    siege -c 1 http://localhost:3000
    

    This happens in both development and production environment.

    Even if I don't do siege, but keep hitting reload constantly on my browser pointing to http://localhost:3000 I will slowly achieve the same result.

    Edited by Rohit Arondekar for formating.

    July 4th, 2010 @ 01:51 PM

  4. drjoke
    drjoke

    I meant.

    /opt/ruby/1.9.2/rails new example cd example
    /opt/ruby/1.9.2/rails server

    It should have been obvious though.

    July 4th, 2010 @ 01:53 PM

  5. drjoke
    drjoke

    Well "cd example" is on a new line. Not sure why I don't get line break.

    July 4th, 2010 @ 01:54 PM

  6. José Valim
    José Valim
    • Milestone cleared.
    • Importance changed from Low to High

    July 4th, 2010 @ 01:54 PM

  7. Rohit Arondekar
    Rohit Arondekar
    • State changed from new to open

    Moodang, thank you for reporting the issue. :)

    P.S fixed formating in your comment, wrapping console commands & code in @@@ is the way to go. Take a look at http://help.lighthouseapp.com/faqs/getting-started/how-do-i-format-... for details.

    July 4th, 2010 @ 02:01 PM

  8. Ryan Bigg
    Ryan Bigg

    You can also indent it using four spaces, like this:

    this is some code
    

    July 26th, 2010 @ 02:16 AM

  9. drjoke
    drjoke

    Has anyone actually look at this?

    July 26th, 2010 @ 04:13 AM

  10. Rohit Arondekar
    Rohit Arondekar

    I got this from a comment by Yehuda Katz in the Ruby forum:

    This is something we're actively looking into. This is likely a problem in Ruby 1.9, but it may already be resolved (http:// redmine.ruby-lang.org/issues/show/3466#note-3). We're working with Aman Gupta (memprof), and have so far been unable to reproduce this issue. We are actively trying though.

    source: http://www.ruby-forum.com/topic/213412#928210

    July 26th, 2010 @ 06:58 AM

  11. Preston Marshall
    Preston Marshall

    Can you try it again with Ruby 1.9.2p0 or greater?

    August 23rd, 2010 @ 08:21 AM

  12. Jeremy Kemper
  13. Ryan Bigg
    Ryan Bigg
    • Tag cleared.

    Automatic cleanup of spam.

    October 9th, 2010 @ 09:47 PM

  14. Rohit Arondekar
  15. José Valim
    José Valim
    • State changed from open to stale

    Please drop a comment if the leak still exists.

    October 15th, 2010 @ 10:47 AM

  16. Jeremy Kemper
  17. Anthony Burns
    Anthony Burns

    I'm seeing a leak right now in a Rails 3.0.1 app on 1.9.2-p0. It happens on several views that poll a JSON-rendering action for status. The memory usage steadily climbs while the page is active, and does not release when the page is no longer active.

    November 5th, 2010 @ 05:56 PM