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
↕: 274
|: 500
Regexp::: 1266
Term::: 1096
_code: 493
UNIVERSAL::: 3012
overload::: 59362
$: 293
time: 994
File::: 82769
↕E_TRIE_MAXBUF: 323
Dos::: 831
size: 964
Data::: 168049
_<..\universal.c: 403
↕E_DEBUG_FLAGS: 319
_<HiRes.c: 381
BEGIN: 253
_<..\mro.c: 391
!: 517
IO::: 1101
☼: 517
total_size: 988
↑: 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
▬: 936
_<perllib.c: 393
2: 524
_<Cwd.c: 375
cmpthese: 37036
1: 533
↨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
↨: 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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|