I have a software? for example: named Spp
how to write a c program to get the max memory of Spp?
thanks!
I have a software? for example: named Spp
how to write a c program to get the max memory of Spp?
thanks!
There is no way.
What's the max memory used by this program?Code:int main() { int x; scanf("%d", &x); malloc(x); for (;;); }
I see!
how to run a command every seconds?
Code:the first second: exec: top -u admin the second second: exec: top -u admin the third second: exec: top -u admin the fourth second: exec: top -u admin
This perhaps?
getrusage(2): resource usage - Linux man page
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Top is reporting information and updates it automatically, which I suppose was sacs7's point with his bash script. You can set the interval to 1 second with the -i flag, I think that is pretty close to default though.