If you have a Java application and if you need to know memory allocation and leakage you can use JMAP command. In this article I will show how to run the command.
1. Find the pid of Java process
In Linux system you can identify using ps command. But the best way is to use JPS command.
In terminal run below command
jps
This command will give output like below.
In above output we see 4 Java process on which one is JPS itself. The prices listed above are SAS Java process.
Using JMAP
For JMAP we need the pid of Java process and the location to store the dump.
In the command line run as below.
jmap -dump:file=/tmp/wrapperStartStop_mem_usage.log -F 147213
Once you run above command you will get message like you see in below screenshot.
The file generated will be as large as current memory configuration.
1. Find the pid of Java process
In Linux system you can identify using ps command. But the best way is to use JPS command.
In terminal run below command
jps
This command will give output like below.
Using JMAP
For JMAP we need the pid of Java process and the location to store the dump.
In the command line run as below.
jmap -dump:file=/tmp/wrapperStartStop_mem_usage.log -F 147213
Once you run above command you will get message like you see in below screenshot.
The file generated will be as large as current memory configuration.
Comments
Post a Comment