New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"Out of memory ... sbrk()" on FreeBSD-6.x for v.5.8.x but not v.5.6.x #9061
Comments
From zeus@dn.farlep.netCreated by zeus@dn.farlep.neti've got reproduceble picture: FreeBSD-6.x + Perl5.8.8 on i386, are affected the script using Image::ExifTool to manipulate EXIF data in batch mode the problems looks so: process memory grows and finaly it is kicked :( yes, ulimit -a shows: data seg size is 524288 but why run under linux the process frees memory? and under M$Win it works? on amd64 the picture differs, top shows: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND while trying to meditate upon the cause, i've launched the debuger --- i would like to point out it again, the problem present only on FreeBSD 6.x with Perl5.8.x (Perl5.6.x not affected) Perl Info
|
From @eserte"zeus@dn.farlep.net (via RT)" <perlbug-followup@perl.org> writes: PATCH below!
The problem can be reproduced with the script below, a low memory #!perl The memory growth looks like this: With a system-malloc (here: FreeBSD-6.2) there's no leak: $ limits -d 30000000 perl ~/trash/memleak_usemymalloc.pl The bug is triggered by the special allocation pattern: the initial The problem can be avoided even with pure perl: just allocate And finally the patch: Inline Patch--- ../bleedperl-amd64/malloc.c Mon Apr 16 01:25:50 2007
+++ ./malloc.c Thu Oct 25 23:37:43 2007
@@ -2285,6 +2285,7 @@ Perl_realloc(void *mp, size_t nbytes)
nmalloc[bucket]--;
nmalloc[pow * BUCKETS_PER_POW2]++;
#endif
+ max_bucket = pow * BUCKETS_PER_POW2;
*(cp - M_OVERHEAD) = pow * BUCKETS_PER_POW2; /* Fill index. */
MALLOC_UNLOCK;
goto inplace_label;
-- tkruler - Perl/Tk program for measuring screen distances |
The RT System itself - Status changed from 'new' to 'open' |
From @eserteOn Do. 25. Okt. 2007, 15:22:51, slaven@rezic.de wrote:
Image::ExifTool::WriteJPEG(/usr/local/lib/perl5/site_perl/5.8.8/Image/ExifTool/Writer.pl:3446):
Image::ExifTool::Write(/usr/local/lib/perl5/site_perl/5.8.8/Image/ExifTool/Writer.pl:3002):
Image::ExifTool::Write(/usr/local/lib/perl5/site_perl/5.8.8/Image/ExifTool/Writer.pl:3003):
Image::ExifTool::Write(/usr/local/lib/perl5/site_perl/5.8.8/Image/ExifTool/Writer.pl:3006):
Don't apply this patch. There must be a condition before the newly Regards, |
From @eserteSlaven Rezic <slaven@rezic.de> writes:
[...]
Here the revised patch: Inline Patch--- ../bleedperl-amd64/malloc.c Mon Apr 16 01:25:50 2007
+++ ./malloc.c Fri Oct 26 16:14:10 2007
@@ -2285,6 +2285,8 @@ Perl_realloc(void *mp, size_t nbytes)
nmalloc[bucket]--;
nmalloc[pow * BUCKETS_PER_POW2]++;
#endif
+ if (pow * BUCKETS_PER_POW2 > max_bucket)
+ max_bucket = pow * BUCKETS_PER_POW2;
*(cp - M_OVERHEAD) = pow * BUCKETS_PER_POW2; /* Fill index. */
MALLOC_UNLOCK;
goto inplace_label;
-- Slaven Rezic - slaven <at> rezic <dot> de Tk-AppMaster: a perl/Tk module launcher designed for handhelds |
From @rgs2007/10/26 Slaven Rezic <slaven@rezic.de>:
Thanks, applied as #34076. |
@rgs - Status changed from 'open' to 'resolved' |
Migrated from rt.perl.org#46381 (status was 'resolved')
Searchable as RT46381$
The text was updated successfully, but these errors were encountered: