Memory leak??? (top reporting high memory usage under Solaris)

Discussion in 'Ruby' started by Mark Probert, Feb 9, 2005.

  1. Mark Probert

    Mark Probert Guest

    Hi ..

    Has anyone seen anything like this?

    load averages: 0.63, 0.30, 0.16
    02:07:51
    134 processes: 118 sleeping, 14 zombie, 2 on cpu
    CPU states: 77.0% idle, 16.8% user, 5.6% kernel, 0.6% iowait, 0.0% swap
    Memory: 4096M real, 2984M free, 2952M swap in use, 2357M swap free

    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    6683 root 1 0 4 1744M 94M cpu0 1:18 16.93% healthcollect.r
    28954 bwczkdj 1 58 0 2608K 1792K sleep 10:55 0.49% top
    ...

    The 13 mins later:

    load averages: 0.57, 0.65, 0.48
    02:20:11
    139 processes: 124 sleeping, 14 zombie, 1 on cpu
    CPU states: 93.9% idle, 3.7% user, 2.4% kernel, 0.0% iowait, 0.0% swap
    Memory: 4096M real, 2678M free, 5294M swap in use, 15M swap free

    PID USERNAME THR PRI NICE SIZE RES STATE TIME CPU COMMAND
    6683 root 1 20 4 4082M 291M sleep 9:15 12.43% healthcollect.r
    ...

    Notice that the reported memory size of the Ruby application is growing? All
    the swap gets consumed and the process dies. Looks like a memory leak
    somewhere, though I could well be mistaken. Certainly, the process reporting
    that it is using 4Gb of memory raise my eye brows.

    As background, this script runs data collection against about 220 network
    elements. The script is multithreaded, with the current thread count at 15.
    Each thread will have a dedicated telnet session to the network element. The
    data collected is sent straight to disk, then post-processed.

    I don't have access to upgrading the hardware, the swap size at all, or the
    ruby version easily.

    $ ruby -v
    ruby 1.8.0 (2003-08-04) [sparc-solaris2.8]

    Regards,
     
    Mark Probert, Feb 9, 2005
    #1
    1. Advertisements

  2. Mark Probert

    Bill Kelly Guest

    Sorry if you already were aware of this; but you should
    typically be able to compile and install a version of
    ruby in your home directory without any superuser privileges.
    ( ./configure --prefix ~/somedir )

    Just wondering if that would give you the opportunity to
    try a different ruby version?


    Regards,

    Bill
     
    Bill Kelly, Feb 9, 2005
    #2
    1. Advertisements

  3. Mark Probert

    llothar Guest

    Correct. Exceptions and the heavy use of ccalloc can result in this
    memory leak. I got this report also from 2 of my ArachnoRuby users, but
    somebody must find a small reproduceable script for this.
     
    llothar, Feb 9, 2005
    #3
  4. Mark Probert

    Mark Probert Guest

    Hi ..

    Unfortunately, the customer here is really strict about software on their
    production servers. I even need someone to run the commands whilst I watch
    over their shoulder :). To get a different version of Ruby is a process of
    many weeks. Though it will happen in the end ..

    Regards,

    -mark.
     
    Mark Probert, Feb 9, 2005
    #4
  5. Mark Probert

    Mark Probert Guest

    Hi ..

    Thanks. I'll see what I can do.

    So exceptions, even caught ones, will trigger a memory leak? Won't the GC
    kick in and clean them up? Or is it only uncaught exceptions?
     
    Mark Probert, Feb 9, 2005
    #5
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.