jmap -F -dump:live,format=b,file=filename.hprof process_id
F: force
live: if set it only prints objects which have active references and discards the ones that are ready to be garbage collected. This parameter is optional
format: in the example above it is set to binary
file: filename that you like your java heap dump to be named