note
BrowserUk
<blockquote><i>I can start sprinkling Devel::Size::size() calls around the code, but that would be rather annoying,</i></blockquote>
<p>If you run Devel::Size against <c>%::</c> 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 [http://search.cpan.org/~browseruk/Devel-Size/lib/Devel/Size.pm|v0.72]; 0.71 will blow up in mysterious way if you try this.)
<code>
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
</code>
<P>It won't always find the leak, but it can point you in the right direction.
<div class="pmsig"><div class="pmsig-171588">
<hr />
<font size=1 >
<div>Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.</div>
<div>"Science is about questioning the status quo. Questioning authority". </div>
<div>In the absence of evidence, opinion is indistinguishable from prejudice.</div>
<div>[http://www.theregister.co.uk/2009/06/11/pcw/|RIP PCW] [http://www.bbc.co.uk/iplayer/console/b00lv1ln|It is as I've been saying!(Audio until 20090817)]</div>
</font>
</div></div>
794209
794209