Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Out of memory!

by quester (Vicar)
on Feb 07, 2007 at 08:34 UTC ( [id://598706]=note: print w/replies, xml ) Need Help??


in reply to Out of memory!

Two other possible, somewhat painful, approaches:

1. Step through the program with the debugger and check the memory size to see where you are in the code when it increases:

$ perl -de0 Loading DB routines from perl5db.pl version 1.28 Editor support available. Enter h or `h h' for help, or `man perldebug' for more help. main::(-e:1): 0 DB<1> !!ps v PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND ... 4763 pts/1 S+ 0:00 0 1013 4874 4348 0.4 perl -de0 DB<2> @array=(1..1_000_000) DB<3> !!ps v PID TTY STAT TIME MAJFL TRS DRS RSS %MEM COMMAND ... 4763 pts/1 R+ 0:01 0 1013 103142 102400 9.8 perl -de0

or,

2. Take a look at "Debugging Perl memory usage" in perldebguts and see if using PERL_DEBUG_MSTATS and Devel::Peek::mstat would help.

...but first look at the output of perl -V and see if it says "usemymalloc=n", in which case you won't have any memory statistics... :-(

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2024-04-24 00:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found