Thread and Heap dumps ,we can use a single command to generate both of these.
But keep remember that generating a heap dump will hang the process you are applying on,till the required file got generated.
You have to set the below statement at JVM during its start up.
-Xdump:java+heap+system+snap:events=user
Command to generate dump : kill -3 <PID> / kill -QUIT <PID>
Access this link if you need some more information.