How can I force a heap dump on a running instance?
You can use the jmap utility comes with jdk.
Syntax is :
jmap [option] <javaprocessid>
(to connect to running process)
example : /usr/java/latest/bin/jmap -dump:format=b,file=/one/PLT/heap.bin 23467
This will create a heap dump file under /one/PLT/heap.bin for Jboss running as PID 23467.
Make sure the user has a writable permission at location where the heap dump being generated. If there are issues with permission sometimes I see error like "HotSpot JVM not found." which is bogus.
For thread dump,
jstack PID > outfile
Reference: http://stackoverflow.com/questions/4876274/kill-3-to-get-java-thread-dump