JVM Memory Utilisation
JVM Memory utilisation in Linux/Unix server
-
- Login to your Linux/Unix Server
- Enter the below command to get the JAVA PID running on the server.
ps –ef|grep –i java
From the output take the application JAVA PID.
- Using below command find out the current JVM Memory Utilization.
ps -opid,rss,vsz –p <Java PID>
Note: The above values will be in KB. RSS will be the current memory utilisation of JVM.
VSZ – Virtual Set Size
The memory size which is assigned to a process(program) during the initial execution is Virtual Set Size (VSZ)and it simply denotes how much memory is available for execution of that process.
RSS – Resident Set Size
As oppose to VSZ ( Virtual Set Size ), RSS is a memory currently used by a process. This is a actual number in kilobytes of how much RAM the current process is using and is the actual memory utilised by a JVM.
Another way to get memory is to use below command to get overall memory utilisation of JVM using jstat command.
$JAVA_HOME/bin/jstat -gc 19125 | tail -1| awk ‘{split($0,a,” “); sum=a[3]+a[4]+a[6]+a[8]+a[10]; print sum ” Kb”}’