You might be able to gather more information on what is using the memory using Devel::Size v0.72.

If you run:

use Devel::Size qw[ total_size ]; ... printf "%s :: %.f\n", $_, total_size( $::{ $_ } ) for keys %::;;

At some point before the crash occurs (experiment), then it will produce a list something like:

/ :: 382 stderr :: 289 SIG :: 3705 , :: 399 utf8:: :: 4359 " :: 347 _<c:/Perl/site/lib/auto/Devel/Size/Size.dll :: 479 DynaLoader:: :: 55772 Devel:: :: 22977 strict:: :: 6435 stdout :: 289 AllocMemory :: 2263 &#8597; :: 262 | :: 383 _<c:/Perl/lib/auto/Time/HiRes/HiRes.dll :: 463 Mac:: :: 1706 CleanString :: 15703 Regexp:: :: 948 _code :: 443 UNIVERSAL:: :: 1872 overload:: :: 39770 $ :: 287 time :: 829 NewString :: 13443 size :: 820 Data:: :: 111665 - :: 679 _<..\universal.c :: 363 _<HiRes.c :: 343 BEGIN :: 287 ! :: 380 IO:: :: 943 &#9788; :: 399 total_size :: 844 &#8593; :: 345 pp :: 12454 _ :: 345 _<c:/Perl/site/lib/auto/Win32/API/API.dll :: 471 + :: 679 Exporter:: :: 81873 Internals:: :: 3436 STDIN :: 287 Config:: :: 91676 warnings:: :: 59111 DB:: :: 850 Time:: :: 33192 _<.\win32.c :: 343 &#9644; :: 345 _<perllib.c :: 343 2 :: 388 _<API.c :: 335 cmpthese :: 27607 1 :: 406 &#8616;ARNING_BITS :: 400 CORE:: :: 930 _<Size.c :: 339 attributes:: :: 962 stdin :: 287 ARGV :: 405 INC :: 2857 Scalar:: :: 1789 ENV :: 6689 ? :: 395 vars:: :: 9565 subs:: :: 3764 _<..\perlio.c :: 351 main:: :: 720485 AutoLoader:: :: 24976 Carp:: :: 31355 VMS:: :: 1229 Win32:: :: 256452 PerlIO:: :: 2378 0 :: 431 :: 562 _<..\xsutils.c :: 355 @ :: 950 ApiLink :: 10523 Benchmark:: :: 131181 STDOUT :: 289 ] :: 355 3 :: 386 &#8616; :: 383 MIME:: :: 1215 STDERR :: 289 _<dl_win32.c :: 330 <none>:: :: 460 sleep :: 839

Which is a crude assessment of the memory being used by each of the packages you have loaded (plus other stuff). That may allow you to zero in on one particular package that is being profligate and then look at that in more detail by examining its symbol table more closely:

[0] Perl> printf "%s :: %.f\n", $_, total_size( $::{ $_ } ) for keys % +{ Benchmark:: };; timesum :: 112 __ANON__ :: 112 cpu_a :: 112 a :: 112 n_to_for :: 112 _doeval :: 112 iters :: 112 _Usage :: 112 Min_CPU :: 112 init :: 112 cmpthese :: 27607 debug :: 112 export :: 112 new :: 112 timestr :: 112 EXPORT_TAGS :: 112 timethis :: 112 countit :: 112 EXPORT_OK :: 112 confess :: 112 EXPORT_FAIL :: 112 timediff :: 112 cpu_c :: 112 b :: 112 ISA :: 112 export_to_level :: 112 Default_Style :: 112 timethese :: 112 time :: 829 Cache :: 112 cpu_p :: 112 Debug :: 112 clearcache :: 112 BEGIN :: 287 Do_Cache :: 112 runloop :: 112 timedebug :: 112 real :: 112 usage :: 112 clearallcache :: 112 timeit :: 112 EXPORT :: 112 croak :: 112 import :: 112 disablecache :: 112 enablecache :: 112 Min_Count :: 112 carp :: 112 Default_Format :: 112 VERSION :: 112 mytime :: 112

Make sure that you get my unofficial v0.72, as previous versions use a substantial amount of memory for internal tracking that skews the results and would probably push you over the limits. My version doesn't suffer that defect.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^3: How to put a fat program on a (memory) weight-loss diet? by BrowserUk
in thread How to put a fat program on a (memory) weight-loss diet? [SOLVED] by locked_user sundialsvc4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.