Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Command to find out -Xms and -Xmx variable values for a given java process?

I have a java program, which i ran and figured out its process id with jps.

How can i see what is the value of -Xms and -Xmx variable for this java process ?

like image 462
Adon Smith Avatar asked Jan 15 '15 09:01

Adon Smith


People also ask

What is XMS and XMX parameter in Java?

The flag Xmx specifies the maximum memory allocation pool for a Java virtual machine (JVM), while Xms specifies the initial memory allocation pool. This means that your JVM will be started with Xms amount of memory and will be able to use a maximum of Xmx amount of memory.

What are the default XMX and XMS values?

The default values for Xmx is based on the physical memory of the machine. The Xmx value is 25% of the available memory with a maximum of 25 GB. However, where there is 2 GB or less of physical memory, the value set is 50% of available memory with a minimum value of 16 MB and a maximum value of 512 MB.

What is XMS XMX while starting JVM?

The flag Xmx specifies the maximum memory allocation pool for a Java Virtual Machine (JVM), while Xms specifies the initial memory allocation pool. The memory flag can also be specified in different sizes, such as kilobytes, megabytes, and so on.


1 Answers

Try

jcmd <PID> VM.command_line
jcmd <PID> VM.flags
like image 113
apangin Avatar answered Sep 20 '22 13:09

apangin