You can use Linux ps command with grep and awk command to print the actual memory usage of an application or process.
Example:
Get the actual memory usage of a process or application in kilobytes (KB):
1 2 3 |
## replace mysqld with the application or process name ## in KB ps auxf | grep mysqld | awk '{sum=sum+$6}; END {print sum,"KB"}' |
Get the actual memory usage of a process or application in megabytes (MB):
1 2 3 |
## replace mysqld with the application or process name ## in MB ps auxf | grep mysqld | awk '{sum=sum+$6}; END {print sum/1024,"MB"}' |
Get the actual memory usage of a process or application in gigabytes (GB):
1 2 3 |
## replace mysqld with the application or process name ## in GB ps auxf | grep mysqld | awk '{sum=sum+$6}; END {print sum/1024/1024,"GB"}' |