I would recommend using the Eclipse MAT to view a heap dump. It does a much better job in terms of memory requirements for a heap of size X heap because it creates intermediate index files on disk, rather than sucking it all into its own memory. Most tools require several N from X to open a heap dump, where N is usually> = 2. Also, be sure to run the Java process, which starts MAT or JProfiler in 64-bit if you are going to give them more than 2 g of memory.
source share