You can use the jmap tool provided with java installation to acquire the memory dump.
Command is something similar to,
Here I have passed some parameter to the jmap command.
live – Only get dump for live objects.
format=b – Format of the output file should be binary.
file=heap.bin – Name of the dump file.
Read more: http://docs.oracle.com/javase/7/docs/technotes/tools/share/jmap.html.