Determine perl program memory usage 
Author Message
 Determine perl program memory usage

[A complimentary Cc of this posting was sent to


Quote:
> Is it possible to determine the amount of memory a perl program
> is using?

With recent enough perl's use
        env PERL_DEBUG_MSTATS=2 perl your_program
(assuming you use perl's malloc).

Quote:
> I have a long running program that seems to consume
> more memory that I would expect and want to determine the
> memory usage a various points in the program.  

To do the above in arbitrary moment you need Devel::Peek.

Ilya



Tue, 10 Aug 1999 03:00:00 GMT  
 Determine perl program memory usage

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc,

:Is it possible to determine the amount of memory a perl program
:is using?  I have a long running program that seems to consume
:more memory that I would expect and want to determine the
:memory usage a various points in the program.  A unix only
:solution is OK.

    system "ps l$$";

--tom
--

    The only disadvantage I see is that it would force everyone to get Perl.
    Horrors.  :-)



Tue, 10 Aug 1999 03:00:00 GMT  
 Determine perl program memory usage


[...]

Quote:
>     system "ps l$$";

This won't work in all versions of Unix.  For example, it works under
SunOS 4.x, but not Solaris 2.x.  (I suppose it's a System V thing.)

I think the Solaris equivalent is "ps -l -p $$".

--

TeleSo^H^H^H^H^H^H Alsy^H^H^H^H Thomson Softw^H^H^H^H^H^H^H^H^H^H^H^H^H Aonix
10251 Vista Sorrento Parkway, Suite 300, San Diego, CA, USA, 92121-2706
"Humor is such a subjective thing." -- Cartagia



Sat, 14 Aug 1999 03:00:00 GMT  
 Determine perl program memory usage

 [courtesy cc of this posting sent to cited author via email]

In comp.lang.perl.misc,


:[...]
:>     system "ps l$$";
:
:This won't work in all versions of Unix.  For example, it works under
:SunOS 4.x, but not Solaris 2.x.  (I suppose it's a System V thing.)
:
:I think the Solaris equivalent is "ps -l -p $$".

Solaris is idiotic.  There was no need to break ps.
Linux proves that you can support both argument forms.

--tom
--

    "It is easier to port a shell than a shell script."
                --Larry Wall



Sun, 15 Aug 1999 03:00:00 GMT  
 Determine perl program memory usage



Quote:
> :I think the Solaris equivalent is "ps -l -p $$".

> Solaris is idiotic.  There was no need to break ps.
> Linux proves that you can support both argument forms.

But if you're using Solaris 2.[5|5.1], then you can get
memory usage in glorious detail by using something
along the lines of :-

/usr/proc/bin/pmap $$

--
Steve Kay



Sun, 15 Aug 1999 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Determining memory usage within Perl

2. cpu usage and memory usage?

3. Determining disk usage...

4. HELP: Perl and LWP Memory Usage

5. monitoring perl's memory usage?

6. question about memory usage in perl

7. Memory usage in Perl

8. How to limit Perl memory usage?

9. Perl memory usage revisited

10. Perl Memory Usage

11. Question about Perl Memory Usage

12. excessive perl memory usage

 

 
Powered by phpBB® Forum Software