Let say my java application is running with some pid number, I have written the program to get my application pid runtime, now how to collect the heap dump for this pid from my java program. I followed the below link but it will give heap dump for all live objects not specific my pid, Is there a way to collect heap dump for only specific to my pid. Assume I have pid number.
https://blogs.oracle.com/sundararajan/programmatically-dumping-heap-from-java-applications