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

M

Mark Probert

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,
 
B

Bill Kelly

From: "Mark Probert said:
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]

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
 
L

llothar

Thomas said:
Hello

With my multithreaded web-rick apps an exception thrown somewhere in
the code sometimes causes the memory used by ruby to spiral out of
control. True for me on Mac OS X with various 1.8.x installs. Hard
for me to repeat though, and when I have cleared all the exception
throwing bugs it goes away.

Not a lot of use, but perhaps a clue. I discovered it was the
exceptions causing the spiral by running the code with the tracer
enabled (which requires a lot of patience for an app of any size)

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.
 
M

Mark Probert

Hi ..

Just wondering if that would give you the opportunity to
try a different ruby version?
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.
 
M

Mark Probert

Hi ..

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.

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?
 

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. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,733
Messages
2,569,440
Members
44,830
Latest member
ZADIva7383

Latest Threads

Top