In-Reply-To: <memo.55405@cix.compulink.co.uk>
The following short script leaks like a sieve on 5.002beta1, but not at
all on 5.001m. I have included some memory statistics, and the output of
myconfig. Some curious things: The number of items pushed onto the
anonymous array referenced by $leak is critical - any less than 125 and
the program size remains constant. If $leak is changed to @leak, the
problem also disappears. Could someone a) confirm that there is a
problem and b) if so, shed some light on what is causing it?
# The following code remains at a constant size when running under 5.001m,
# but grows continuously under 5.002beta1 patch level f
my $i;
for ($i = 10000; $i > 0; $i--)
{
my $leak = [];
my $j;
# The number 125 is critical -
# any less than this and the program size stays constant
for ($j = 125; $j > 0; $j--) { push(@$leak, "Z"); }
}
MEMORY STATS - Perl compiled with -DDEBUGGING_MSTATS
====================================================
Run 1: $j = 124
---------------
Memory allocation statistics after compilation: (buckets 8..16384)
21368 free: 187 26 54 31 13 5 3 3 4 0 0 0
52360 used: 69 102 202 193 19 3 1 9 1 0 0 1
Memory allocation statistics after execution: (buckets 8..16384)
23352 free: 187 26 180 31 13 5 3 1 4 0 0 0
54472 used: 69 102 204 193 19 3 1 11 1 0 0 1
Run 2: $j = 125
---------------
Memory allocation statistics after compilation: (buckets 8..16384)
21368 free: 187 26 54 31 13 5 3 3 4 0 0 0
52360 used: 69 102 202 193 19 3 1 9 1 0 0 1
Memory allocation statistics after execution: (buckets 8..16384)
23352 free: 187 26 180 31 13 5 3 1 4 0 0 0
5174472 used: 69 102 204 193 19 3 10001 11 1 0 0 1
OUTPUT OF myconfig
==================
Summary of my perl5 (patchlevel 2) configuration:
Platform:
osname=linux, osver=1, archname=i486-linux
uname='linux fubar 1.2.13 #2 sat oct 28 19:55:36 gmt 1995 i486 '
hint=previous
Compiler:
cc='gcc', optimize='-O2', ld='gcc'
cppflags='-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL
-DDEBUGGING_MSTATS'
ccflags ='-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL
-DDEBUGGING_MSTATS'
ldflags =''
stdchar='char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=undef, d_castneg=define
intsize=4, alignbytes=4, usemymalloc=y, randbits=31
Libraries:
so=so
libpth=/lib /usr/lib
libs=-lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt -lbsd
libc=/usr/lib/libc.so.5
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef
cccdlflags='-fpic', ccdlflags='-rdynamic', lddlflags='-shared'
Alan Burlison aburlison@cix.compulink.co.uk
The following short script leaks like a sieve on 5.002beta1, but not at
all on 5.001m. I have included some memory statistics, and the output of
myconfig. Some curious things: The number of items pushed onto the
anonymous array referenced by $leak is critical - any less than 125 and
the program size remains constant. If $leak is changed to @leak, the
problem also disappears. Could someone a) confirm that there is a
problem and b) if so, shed some light on what is causing it?
# The following code remains at a constant size when running under 5.001m,
# but grows continuously under 5.002beta1 patch level f
my $i;
for ($i = 10000; $i > 0; $i--)
{
my $leak = [];
my $j;
# The number 125 is critical -
# any less than this and the program size stays constant
for ($j = 125; $j > 0; $j--) { push(@$leak, "Z"); }
}
MEMORY STATS - Perl compiled with -DDEBUGGING_MSTATS
====================================================
Run 1: $j = 124
---------------
Memory allocation statistics after compilation: (buckets 8..16384)
21368 free: 187 26 54 31 13 5 3 3 4 0 0 0
52360 used: 69 102 202 193 19 3 1 9 1 0 0 1
Memory allocation statistics after execution: (buckets 8..16384)
23352 free: 187 26 180 31 13 5 3 1 4 0 0 0
54472 used: 69 102 204 193 19 3 1 11 1 0 0 1
Run 2: $j = 125
---------------
Memory allocation statistics after compilation: (buckets 8..16384)
21368 free: 187 26 54 31 13 5 3 3 4 0 0 0
52360 used: 69 102 202 193 19 3 1 9 1 0 0 1
Memory allocation statistics after execution: (buckets 8..16384)
23352 free: 187 26 180 31 13 5 3 1 4 0 0 0
5174472 used: 69 102 204 193 19 3 10001 11 1 0 0 1
OUTPUT OF myconfig
==================
Summary of my perl5 (patchlevel 2) configuration:
Platform:
osname=linux, osver=1, archname=i486-linux
uname='linux fubar 1.2.13 #2 sat oct 28 19:55:36 gmt 1995 i486 '
hint=previous
Compiler:
cc='gcc', optimize='-O2', ld='gcc'
cppflags='-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL
-DDEBUGGING_MSTATS'
ccflags ='-D__USE_BSD_SIGNAL -Dbool=char -DHAS_BOOL
-DDEBUGGING_MSTATS'
ldflags =''
stdchar='char', d_stdstdio=define, usevfork=false
voidflags=15, castflags=0, d_casti32=undef, d_castneg=define
intsize=4, alignbytes=4, usemymalloc=y, randbits=31
Libraries:
so=so
libpth=/lib /usr/lib
libs=-lndbm -lgdbm -ldbm -ldb -ldl -lm -lc -lcrypt -lbsd
libc=/usr/lib/libc.so.5
Dynamic Linking:
dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef
cccdlflags='-fpic', ccdlflags='-rdynamic', lddlflags='-shared'
Alan Burlison aburlison@cix.compulink.co.uk