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
↕ :: 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
☼ :: 399
total_size :: 844
↑ :: 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
▬ :: 345
_<perllib.c :: 343
2 :: 388
_<API.c :: 335
cmpthese :: 27607
1 :: 406
↨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
↨ :: 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.
|