I have a Ubuntu 16.4 on an AWS EC2 instance and I have installed java 1.8 and tomcat 8 on this machine. I have deployed one Spring MVC application on this machine. Quite often it gets out of memory issue. I want to analyze the heap dump and I tried by using the below command.
sudo jmap -dump:format=b,file=/opt/tmp/heapdump.bin 37320
But when I execute the above command got the below message.
Unable to open socket file: target process not responding or HotSpot VM not loaded
I want to get the java heap dump from my EC2 instance. Thanks in advance.