eclipse-mat / mat

The Eclipse Memory Analyzer is a fast and feature-rich Java heap dump analyzer that helps you find memory leaks and reduce memory consumption.
https://eclipse.dev/mat/
Eclipse Public License 2.0
41 stars 8 forks source link

Experiment: Use MAT for analyzing heapdumps from ruby #27

Open eclipsewebmaster opened 2 months ago

eclipsewebmaster commented 2 months ago

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

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.

eclipsewebmaster commented 2 months ago

By Krum Tsvetkov on Aug 01, 2016 02:34

Created attachment 263401 a pre-built eclipse plugin

Adding a pre-built eclipse plugin. This way one could try the new parser without having to run MAT from source.

org.eclipse.mat.ruby_1.0.0.201608010829.jar

eclipsewebmaster commented 2 months ago

By Krum Tsvetkov on Aug 01, 2016 02:35

Somehow my gerrit change list didn't get automatically reported here. This is it:\ https://git.eclipse.org/r/#/c/78241/2

eclipsewebmaster commented 2 months ago

By Pierre-Yves Bigourdan on Nov 20, 2019 18:06

This would be a nice addition to the MAT project!