| skrye,
I'm a developer and this is my attempt at a simple memory usage profiling for an application I'm testing:
1) I was aiming for a _relative_ elapsed time, i.e. number of milliseconds since the start of the process, not absolute time. (This makes for simple graphing and comparison across multiple runs and versions.)
2) Running GetMemUsage as a daemon certainly has its advantages but requires root privileges, and that's not always possible. However, please post your solution so I can see if I can adapt it to my needs.
My original thinking is this:
a1) write a launch script and names it the same as the monitored process (of course, rename the monitored process to something else), thus achieving transparency. (This means a different launch script for each monitored process. Since I'm a developer interested in a few particular applications, this is fine.) Or,
a2) pass the name of the monitored process as an argument to the launch script
b) This launch script, running as a user process, would first launch GetMemUsage in the background, then launch the monitored process in the foreground. The launch script would end when the monitored process ends (either normally or interrupted via Ctrl-C, which in my case, happens quite frequently). When the launch script ends, it would end the GetMemUsage script, preferably cleanly (so far I can only think of kill -9), as part of its cleanup.
Looking forward to seeing your solutions. |