Java -xmx -xms total memory set in bash

Use following commands to know how much memory all java processes take of your Linux server with bash. Handy for Oracle Weblogic administrators:

MINIMUM

[oracle@heuring.com ~]$ ps -ef | grep -oh 'Xms[0-9]*' | cut -d's' -f2 | awk '{SUM += $1} END { print SUM}'

MAXIMUM

[oracle@heuring.com ~]$ ps -ef | grep -oh 'Xmx[0-9]*' | cut -d'x' -f2 | awk '{SUM += $1} END { print SUM}'