Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Current size of allocated perl memory?

by brycen (Monk)
on Apr 07, 2009 at 23:22 UTC ( #756185=perlquestion: print w/replies, xml ) Need Help??

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

So I'm tracking a memory leak. Can anyone suggest an easy way to get the current perl memory footprint? I tried Proc::ProcessTable and did not find it easy. I'd just like a count of allocated perl objects, or the total C memory size. Devel::Leak and Devel::Cycle have not worked for me, so I'm brute forcing it, and I'm pretty sure the road leads to DBI. Thanks!

Replies are listed 'Best First'.
Re: Current size of allocated perl memory?
by shmem (Chancellor) on Apr 07, 2009 at 23:58 UTC
    print "current mem: ".`ps -o vsz= -p $$`*1024, $/

    For more accurate information, I'd compile a perl with -DDEBUGGING. See perlrun.

Re: Current size of allocated perl memory?
by almut (Canon) on Apr 07, 2009 at 23:29 UTC
Re: Current size of allocated perl memory?
by brycen (Monk) on Apr 09, 2009 at 16:54 UTC
    I found my memory leak by the way. It is in the C code of DBI's DBD::Pg 1.49 on Debian Etch. It uses the perl memory allocator, and affects BYTEA columns.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://756185]
Approved by almut
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2022-12-04 19:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?