JVM Memory utilisation in linux/Unix

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>

jvm-memory-using-ps

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”}’

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s