While parsing a heap dump in eclipse sometimes it throws Out of Java Heap Space error. This basically is because of a large file (5 GB+) I was trying to parse and eclipse was started with only, see below, in most cases this was ok but it kept failing for a large file.
-vmargs -Dosgi.requiredJavaVersion=1.7 -Xms256m -Xmx2024m
To resolve this find the eclipse.ini in your eclipse install location, open it with a text editor and change the -vmargs,
-vmargs -Dosgi.requiredJavaVersion=1.7 -Xms256m -Xmx3024m