http://www.perlmonks.org?node_id=87105

entropy has asked for the wisdom of the Perl Monks concerning the following question:

I have a perl program that forks like it's no tomorrow... I want to know the total memory usage at any given time. This seems tricky to me since much of the memory (most of the perl interpreter, in fact) is shared between all processes. I would also like to know the total CPU time used, including from child processes that may have died. The Proc::ProcessTable will give me many useful fields, but it seems I may have to add some of these numbers together in order to get what I want.

Originally posted as a Categorized Question.

  • Comment on How do I find the total memory/cpu usage of a process and all of its children?

Replies are listed 'Best First'.
Re: How do I find the total memory/cpu usage of a process and all of its children?
by jorg (Friar) on Jun 09, 2001 at 13:54 UTC
    Have a look at the Benchmark module that comes included with any standard perl distribution. It will give you an idea on how much resources a process + its children are using.
Re: How do I find the total memory/cpu usage of a process and all of its children?
by I0 (Priest) on Jun 10, 2001 at 04:14 UTC
Re: How do I find the total memory/cpu usage of a process and all of its children?
by stuffy (Monk) on Jun 09, 2001 at 13:19 UTC
    If on a Linux box, running "top" from the consol will list the top processes running, and give cpu usage and memory percentage.