Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Re: Re: Perl memory Memory consumption

by jarich (Curate)
on Nov 24, 2001 at 10:30 UTC ( [id://127236]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Perl memory Memory consumption
in thread Perl memory Memory consumption

First of all let me say that I dearly hope that the conditional in this while loop has a typographical error:
while(($key, $msg) = each %$msg) { process_msg($bs,$msg); }
I hope you mean:
while(($key, $msg) = each %$record)
If you don't mean this, then this might be some of your problem. Try renaming your hash value.

You can also make this much easier to read by using a foreach loop (if you only want to handle the msg):

foreach my $msg (values %$records) { process_msg($bd, $msg); }

Anyway, I wanted to suggest that you look at Perl's profiling package. It can't exactly help you find out where all your memory is going, but it might help you track down where it's being lost. (Note that you should definately be using "my" for each of your variables to ensure that they don't hang around out of scope.)

You can read about Perl's profiling package with perldoc Devel::DProf

The shorts of it are to profile a script run the perl interpreter with the -d switch. So perl -d:DProf test.pl. when it's done, check the results by running dprofpp or dprofpp -T.

I hope that helps. :)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-20 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found