I'm trying to measure the memory of a process that I call via the command line (i.e., I want to find out much CPU/RAM the process takes). Is there any command that I can add to the command calling the process that will achieve this?
Ubuntu – How to measure how much CPU and RAM has been used by a command
command linecpu loadram
Best Answer
top
Example of firefox. Find the PID:
Then you can use
top -p pid
:ps
You can also use
ps
command, firefox pid is 3845I am not satisfied with the above mentioned commands, and I found something that you should be interested in.
Monit
Edit the Monit Config File
Enable the web interface
Checking process every 2 secons
Example Firefox
In the end copy paste the following command
Save and Exit
Check your syntax
Fix any problems found – it’s not too tough to figure out what’s going on.
Start (or restart) Monit
Visit the web interface
http://localhost:2812
if you’re running Ubuntu Desktop, orSign in with your
admin:monit
credentialsClick on Firefox
Related:
You can also use these links for help and modify your process.
UPDATE
You can also configure an alert if firefox uses more than 250 MB of ram
You can also execute command
You can also make a script of Notify-Send