When we are trying to analyze a huge hprof dump file, we sometimes experience the following error:
java.lang.OutOfMemoryError: Requested length of new long[2,147,483,640] exceeds limit of 2,147,483,639
This seems to be a known java/MAT limitation:
"Memory Analyzer has an architectural limit of 2^31 - 3 objects, a current limit of 2^31 - 8 = 2,147,483,640 objects, but has not been tested with that many objects."
https://bugs.eclipse.org/bugs/show_bug.cgi?id=473113
There is a workaround to analyze so large heap dumps, by discarding a percentage of some kind of objects e.g. "String":
Try
Window > Preferences > Memory Analyzer > HPROF Parser
Enable discard
Discard percentage: 80
Discard object type pattern: char\[\]|java\.lang\.String
That should discard 80% of the Strings and char[] arrays, perhaps bringing the total number of objects to less than 2,147,483,640.
https://bugs.eclipse.org/bugs/show_bug.cgi?id=563960#c6
You will also need to download the latest MAT version.
Add Comment
Comments
Article is closed for comments.