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 RAM it takes to for the process ). Is there any command that I can add to the command calling the process that will achieve this?
Example of firefox
Shows you the pid of firefox process, Then you can use top -p pid
You can also use ps command, firefox pid is 3845
The truth is that i am not satisfied with the above mentioned commands, do not know why... so i start googling and after 3 hours 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
Sign in with your admin:monit credentials
Click on Firefox
I hope this will help you
Helpful Links You should check
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
I just run it from terminal cauzz my script is not working, so if any would make a script please share with us
The Gnu time command can print the maximum resident set size used by a command. You do have to make sure to use the /usr/bin/time command, not the Bash Shell built-in time keyword.
For an example to measure the firefox command:
After using firefox a while, I close it out to get the report:
While it is possible to use the TIME environment variable to set the default format I've found it more flexible to set up individual bash aliases with specific formats. So for the above I would add to my ~/.bash_aliases file:
So that from my Bash Shell I could just enter: