Bug 498944 - Experiment: Use MAT for analyzing heapdumps from ruby
Summary: Experiment: Use MAT for analyzing heapdumps from ruby
Status: CLOSED MOVED
Alias: None
Product: MAT
Classification: Tools
Component: Core (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 enhancement with 1 vote (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-08-01 02:23 EDT by Krum Tsvetkov CLA
Modified: 2024-05-08 15:41 EDT (History)
1 user (show)

See Also:


Attachments
a pre-built eclipse plugin (18.85 KB, application/octet-stream)
2016-08-01 02:34 EDT, Krum Tsvetkov CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Krum Tsvetkov CLA 2016-08-01 02:23:28 EDT
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.
Comment 1 Krum Tsvetkov CLA 2016-08-01 02:34:20 EDT
Created attachment 263401 [details]
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.
- download latest mat
- copy the attached jar into <MAT>/plugins
- copy the gson parser (e.g. from  orbit http://download.eclipse.org/tools/orbit/downloads/drops/R20130118183705/repository/plugins/com.google.gson_2.1.0.v201203072145.jar) to <MAT>/plugins
- open heap dumps from ruby (extension of the files must be .json)
Comment 2 Krum Tsvetkov CLA 2016-08-01 02:35:26 EDT
Somehow my gerrit change list didn't get automatically reported here. This is it:
https://git.eclipse.org/r/#/c/78241/2
Comment 3 Pierre-Yves Bigourdan CLA 2019-11-20 18:06:24 EST
This would be a nice addition to the MAT project!
Comment 4 Eclipse Webmaster CLA 2024-05-08 15:41:47 EDT
This issue has been migrated to https://github.com/eclipse-mat/org.eclipse.mat/issues/27.