Reputation: 107
I want a bash script which will calculate the amount of memory used by specific application or command.
Upvotes: 2
Views: 360
Reputation: 360095
ps o rss= -p PID
will output the resident set size of the given process.
Use size
instead of rss
to get the code+data+stack size.
Upvotes: 2
Reputation: 3963
possible way:
use top
within terminal, then pipe the output into a file and get the line you need (grep)
Upvotes: 1