Is there a way to get a list of all GC roots in my Ruby program? I know
there is a memory leak somewhere in my application, I just don't know in
which part. Listing all variables on the Heap becomes too large, but just
seeing the GC roots would be a great help. Can you suggest some ideas?
Is there a way to get a list of all GC roots in my Ruby program? I
know there is a memory leak somewhere in my application, I just don't
know in which part. Listing all variables on the Heap becomes too
large, but just seeing the GC roots would be a great help. Can you
suggest some ideas?
I don't think this info is available. But how about statistics per class?
That way you can at least determine which class is responsible for the
massive object count.
Is there a way to get a list of all GC roots in my Ruby program? I know
there is a memory leak somewhere in my application, I just don't know in
which part. Listing all variables on the Heap becomes too large, but just
seeing the GC roots would be a great help. Can you suggest some ideas?
Best wishes,
Sven C. Koehler
There's a ruby patch to show what objects are reachable from the roots
(and the chain of references in each case):
In message <20051201155717.GI20330@boing.buug.de>, Sven C. Koehler <schween@snafu.de> writes
Is there a way to get a list of all GC roots in my Ruby program? I know
there is a memory leak somewhere in my application, I just don't know in
which part. Listing all variables on the Heap becomes too large, but just
seeing the GC roots would be a great help. Can you suggest some ideas?
--
Stephen Kellett
Object Media Limited http://www.objmedia.demon.co.uk/software.html
Computer Consultancy, Software Development
Windows C++, Java, Assembler, Performance Analysis, Troubleshooting
I tried to use the patch with Ruby 1.8.3 and the current CVS Trunk
snapshot as of today (2005-12-02). With Ruby 1.8.3 I had to adjust the
rb_sprintf calls to use snprintf. In order to use the patch with the
current Trunk, I had to apply part of the patch by hand. However, I got
no usable output by trying to use it on both versions, so I don't know
whether the patch is actually able to access the GC roots.
The output looks on both ruby 1.8.3 and the CVS Trunk as this: