I have a dump which I opened with Eclipse Memory Analyzer.
I would like to export some contents of the heap into a file.
One of the fields I'm interested in is an ArrayList and I could not find a way to query the dump in a way that will return the contents of the array list as an output:
Selecting the ArrayList object itself returns something like:
java.util.ArrayList [id=0xf2765680]Selecting the array within the array list (
select arr.elementData...) returns something like:java.lang.Object[] [id=0xf2765698;length=4]Selecting
toString(arr)ortoString(arr.elementData)returns empty string when the arrayList isn't null (and the stringnullwhen it is).
Is it really impossible??
I encountered the same issue today with an array. I could not find a way to do this using OQL, but I did find a way using the Eclipse Memory Analyzer itself.
Select the parent object of the data you want to export. Your collection should now show in the Attributes tab on the left of the screen.
Right click the collection in the Attributes list and select Copy - Save Value to File or Copy - Value.
If you choose Save Value to File, specify the file location. The contents of the collection will be output to the file.
Alternatively there appears to be an option to extract the values in a list.
I have not attempted the second option but I hope this helps you or anyone else searching this topic.