D
doron
I am writing a server using ruby 1.8.6 patchlevel 287. It connects to
another server, fetches and process information.
Sometimes it needs to process a lot of information. It uses net/http
and REXML libraries.
My problem is that at some point the process memory usage grows from
20MB to 300MB.
I used gdb and rb_object_counts to look at the number of objects it
uses.
While the memory usage is low i see it uses 20K Strings, 1k or Arrays
etc.
While the memory usage is high i see it uses 1M Strings, 200k or
Arrays etc.
After a while, when the load is over, it again uses only 20K string
and 1K Arrays. It seems that GC worked fine.
But the memory usage I see using top is still around 300MB.
Does it mean I have memory leaks?
I read somewhere that "MRI's garbage collector never returns memory to
the system". that can explain what I see, but is it true? If so, is
there any solution?
another server, fetches and process information.
Sometimes it needs to process a lot of information. It uses net/http
and REXML libraries.
My problem is that at some point the process memory usage grows from
20MB to 300MB.
I used gdb and rb_object_counts to look at the number of objects it
uses.
While the memory usage is low i see it uses 20K Strings, 1k or Arrays
etc.
While the memory usage is high i see it uses 1M Strings, 200k or
Arrays etc.
After a while, when the load is over, it again uses only 20K string
and 1K Arrays. It seems that GC worked fine.
But the memory usage I see using top is still around 300MB.
Does it mean I have memory leaks?
I read somewhere that "MRI's garbage collector never returns memory to
the system". that can explain what I see, but is it true? If so, is
there any solution?