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
Example of firefox. Find the PID:
Then you can use
top -p pid:
You can also use
pscommand, firefox pid is 3845
I am not satisfied with the above mentioned commands, and I found something that you should be interested in.
Edit the Monit Config File
Enable the web interface
Checking process every 2 secons
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:2812if you’re running Ubuntu Desktop, or
Sign in with your
Click on Firefox
You can also use these links for help and modify your process.
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