Monitoring memory use

Kent Johnson kent37 at tds.net
Fri Sep 21 11:28:15 EDT 2007


Lloyd Kvam wrote:
> On Fri, 2007-09-21 at 09:44 -0400, Kent Johnson wrote:
>> I guess I can write this myself as a Python program that runs the 
>> desired program as a child process and monitors its memory usage by 
>> reading /proc/<pid>/stats. There is also the Python library function 
>> resource.getrusage() but it doesn't seem to help - the ru_maxrss 
>> parameter is always 0.
> 
> The file status (/proc/####/status) provides labels for the data and
> would be easy to parse into a dictionary.

Um, yes, that is what I meant to write above.

> If you are tightly focused on memory, statm may be a better file to use
> than stats.  The second field is the RSS pages value.

Thanks

> You didn't specify which cron job caused the problem, but if it was
> from /etc/cron.daily, the different pieces get kicked off in series.  If
> you do not already know the culprit, that can complicate things a bit.  

I do know which job it is, it has its own crontab entry and the alert 
from WF includes individual processes.

Thanks everyone for the tips!

Kent


More information about the gnhlug-discuss mailing list