• Register
0 votes

Problem :

I had to run the jmap so that I can take the heap dump of my process. But the jvm returned below error :

Unable to open socket file: target process not responding or HotSpot VM not loaded

The -F option can be used when the target process is not responding

So I tried using the -F:

./jmap -F -dump:format=b,file=heap.bin 10330

Attaching to process ID 10331, please wait...

Debugger attached successfully.

Server compiler detected.

JVM version is 24.51-b03

Dumping heap to heap.bin ...

1.      Using -F is correct approach to take the heap dump?

2.      I am waiting for more than 20 minutes and not finished yet. Any ideas why it is taking so long?

6 5 3
7,540 points

Please log in or register to answer this question.

1 Answer

0 votes

Solution :

jmap -F OR  jstack -F

While trying to run with -F the tools switch to the special mode that features the HotSpot Serviceability Agent. In current mode the target process is frozen; the tools often read its memory via the OS debugging facilities, namely, ptrace on the Linux.

1.      jmap -F invokes the PTRACE_ATTACH on your target JVM. Your target process is unconditionally suspended in response to the SIGSTOP signal.

2.      The tool reads the JVM memory using PTRACE_PEEKDATA. Here ptrace can read only one word at the time, so too many calls are required to read the large heap of your target process. This is too slow.

3.      The tool reconstructs your JVMs internal structures based on the knowledge of the particular JVMs version. As different versions of JVM have the different memory layout, your -F mode works only if the jmap comes from the same JDK as that of the target Java process.

4.      The tool will create heap dump itself and after that resumes the target process.

9 7 4
38,600 points

Related questions

0 votes
1 answer 131 views
Problem : I am having a box with 8gb of ram, so I don't think the total memory is the issue. This application is running properly on boxes with 6gb or less ram. What I am trying to do is to reserve 3GB of space using -Xmx3G command under "VM ... : Error occurred during initialization of VM; Could not reserve enough space for object heap using -Xmx3G Why am I getting such error any clue?
asked Nov 26, 2019 alecxe 7.5k points
1 vote
1 answer 186 views
Problem : I have recently started learning Android. If I try to execute my Android project on my Eclipse ADT then I often see below errors in my Console: [Dex Loader] Failed to load C:\Users\Martin\android-sdks\build-tools\26.0.0-preview\lib\dx.jar [ ... this case "C:\Users\Martin\android-sdks" is considered as the SDK folder. Kindly help me in fixing above strange looking Android error.
asked May 21, 2020 Martin K 6.6k points
1 vote
1 answer 2K views
Problem: I am a windows seven user and recently I’ve installed JDK to learn java but I am getting an error. The message is something like: Missing server JVM at `C:\Program Files\Java\jre7\bin\server\jvm­­.dll' please install or use the JRE or JDK that contains these missing components. Your kind solution is much appreciated.
asked Mar 22, 2020 Gavin 15.3k points
0 votes
1 answer 1.5K views
Problem : I am beginner to Java. I have one doubt about Java Compilers as below. “For compiling a java code we have separate compilers for different os.” Can someone answer my question?
asked Feb 29, 2020 mphil 2.3k points
0 votes
1 answer 3 views
How to remove this message?
asked 6 days ago TeamScript 11.1k points
0 votes
2 answers 917 views
Problem : I have recently downloaded VS 2013 Community Edition and I have written the first app. When I try to run it, it usually shows me the below output section: 'ConsoleApplication1.exe' (Win32): Loaded 'D:\Users\Toshiba\Documents\Visual Studio 2019\Projects\ConsoleApplication1 ... so I know that the problem is not in my code. Have anybody faced the above issue and know the solution on it?
asked Dec 21, 2019 alecxe 7.5k points
0 votes
1 answer 73 views
Problem : My problem kicked off when I was unable to log in as the root any more on the mysql install. I was trying to run mysql without the passwords turned on however when I ran my below command : # mysqld_safe --skip-grant-tables & I never got my prompt back. ... socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
asked Jan 4, 2020 alecxe 7.5k points
0 votes
1 answer 43 views
Problem : My problem started with me when I was unable to log in as root any more on the mysql install. I was trying to run mysql without passwords turned on... but whenever I ran the below command # mysqld_safe --skip-grant-tables & I would never get my prompt back ... socket '/var/run/mysqld/mysqld.sock' (2)' Check that mysqld is running and that the socket: '/var/run/mysqld/mysqld.sock' exists!
asked Dec 27, 2019 alecxe 7.5k points