mat
mat copied to clipboard
Experiment: Use MAT for analyzing heapdumps from ruby
| --- | --- | | Bugzilla Link | 498944 | | Status | NEW | | Importance | P3 enhancement | | Reported | Aug 01, 2016 02:23 EDT | | Modified | Nov 20, 2019 18:06 EDT | | See also | Gerrit change https://git.eclipse.org/r/78241 | | Reporter | Krum Tsvetkov |
Description
Recently I had to deal with a an issue, which looked like a memory leak in a ruby program.
It turned out that ruby offers already means to create a heap dump (http://ruby-doc.org/stdlib-2.1.0/libdoc/objspace/rdoc/ObjectSpace.html), however I didn't find tools comparable to MAT to read the information.
I gave it a try and wrote a parser extension for MAT for the ruby dumps.
At the end I think this helped me quite well with the analysis.
However, MAT is still very Java-focused, and I had to fake a few things, like
- classloader
- superclasses (I didn't find the info in the heap dump)
- the pseudo refs from each object to its class which we put for the java dumps (the parsing didn't work without such refs)
On the other hand, I had to leave a few infos out, e.g. allocation information.
For a non-java developer the combination could look quite confusing I think.
I'll share in gerrit the code I have. So far it was more for fun (and to help myself) exercise.
Let's see / discuss if MAT can offer support for ruby dumps, so that a ruby developer could perform reasonable analysis, and not be very confused by all the functionality which was faked or which doesn't work with the ruby dumps.
There were already some postings about javascript dumps on the mailing list, so obviously extending MAT to support other languages doesn't sound too awkward.