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

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I can start sprinkling Devel::Size::size() calls around the code, but that would be rather annoying,

If you run Devel::Size against %:: in the outermost loop of your program and then compare the output from one run to the next, it can help you isolate where the memory growth is occuring, you can then look more closely at the relevant area(s). (BTW: You'll need v0.72; 0.71 will blow up in mysterious way if you try this.)

use Devel::Size qw[ total_size];; printf "%30s: %d\n", $_, total_size( $::{ $_ } ) for keys %::;; _<C:/Perl64/site/lib/auto/Cwd/Cwd.dll: 499 version::: 13009 /: 490 stderr: 303 SIG: 5964 ,: 509 Tie::: 7454 utf8::: 5741 ": 405 constant::: 28942 re::: 44435 DynaLoader::: 63651 mro::: 5947 Devel::: 32202 Cwd::: 126954 strict::: 9683 stdout: 303 &#8597;: 274 |: 500 Regexp::: 1266 Term::: 1096 _code: 493 UNIVERSAL::: 3012 overload::: 59362 $: 293 time: 994 File::: 82769 &#8597;E_TRIE_MAXBUF: 323 Dos::: 831 size: 964 Data::: 168049 _<..\universal.c: 403 &#8597;E_DEBUG_FLAGS: 319 _<HiRes.c: 381 BEGIN: 253 _<..\mro.c: 391 !: 517 IO::: 1101 &#9788;: 517 total_size: 988 &#8593;: 370 pp: 19157 _: 497 ActivePerl::: 137287 _<C:/Perl64/lib/constant.pm: 463 Exporter::: 120414 Internals::: 4478 STDIN: 253 Config::: 113324 warnings::: 93953 DB::: 1071 Time::: 47484 EPOC::: 833 _<.\win32.c: 393 &#9644;: 936 _<perllib.c: 393 2: 524 _<Cwd.c: 375 cmpthese: 37036 1: 533 &#8616;ARNING_BITS: 553 CORE::: 1086 _<Size.c: 379 Win32CORE::: 1174 attributes::: 1176 stdin: 301 ARGV: 499 INC: 5306 _<..\activeperl.c: 405 _<C:/Perl64/site/lib/auto/Devel/Size/Size.dll: 533 Scalar::: 2018 ENV: 10062 ?: 493 vars::: 15120 subs::: 5644 _<..\perlio.c: 397 _<Win32CORE.c: 397 XSLoader::: 27593 main::: 1006356 AutoLoader::: 40075 VMS::: 2363 Carp::: 44867 Win32::: 17184 PerlIO::: 3024 0: 541 : 850 _<..\xsutils.c: 399 @: 1074 Benchmark::: 200847 n: 282 STDOUT: 255 3: 504 ]: 393 _<C:/Perl64/lib/auto/Time/HiRes/HiRes.dll: 509 &#8616;: 499 MIME::: 1412 STDERR: 255 ActiveState::: 72715 _<dl_win32.c: 401 sleep: 998

It won't always find the leak, but it can point you in the right direction.


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.

In reply to Re: how much memory each Perl variable uses by BrowserUk
in thread how much memory each Perl variable uses by amir_e_a

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, 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, 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.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others browsing the Monastery: (5)
    As of 2020-01-23 22:19 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      Notices?