Closed p5pRT closed 9 years ago
The attached script displays some bizarre memory characteristics on different versions of Perl.
With perl-5.20.0\, the loop at the bottom will leak memory if the Dumper($content) call is commented out.
If you uncomment that line\, there's no leak. This behaviour is mirrored on perl-5.10.1.
With bleadperl\, it leaks either way.
With perl-5.14.1\, it will not leak\, but without the Dumper Perl uses ~58M resident; with the Dumper it uses upwards of 130M resident. (Possibly a separate\, unrelated issue (or not an issue at all?).
I originally thought this was UTF8 related\, but I just tested with replacing the smiley face with a normal character\, and still see the weird behaviour.
This *could* be a bug with XML::Simple and/or XML::SAX\, but the different behaviours on different Perls is suspect.
You'll need to install XML::Simple and Variable::Magic. To install Variable::Magic on blead\, you'll need to skip tests for now or apply sprouts patch here: https://rt.cpan.org/Public/Ticket/Attachment/1407023/746879/open_BUc83oif.txt
-- Matthew Horsfall (alh)
I originally thought this was UTF8 related\, but I just tested with replacing the smiley face with a normal character\, and still see the weird behaviour.
And if I remove the Variable::Magic\, I still get the weird behaviour....
-- Matthew Horsfall (alh)
On Tue\, Sep 16\, 2014 at 11:00:14AM -0400\, Matthew Horsfall (alh) wrote:
I originally thought this was UTF8 related\, but I just tested with replacing the smiley face with a normal character\, and still see the weird behaviour.
And if I remove the Variable::Magic\, I still get the weird behaviour....
I've had a play with it with blead (minus any Variable::Magic-related lines).
VM usage gradually grows whether or not I call Data::Dumper.
I then looked at it under valgrind. Running it for 1\,2\,3 and 4 iterations all showed the same final memory usage. Perl doesn't normally free up SV arenas before exit\, which would account for non-zero memory usage at the end. Doing the valgrind with PERL_DESTRUCT_LEVEL=2 (which forces perl to free up everyhing it knows about before exit) gives no significant leaked memory.
So think it most likely that its just malloc() fragmentation.
Decreasing the size of the data structure below about 33500 elements stopped the VM growth for some reason.
-- That he said that that that that is is is debatable\, is debatable.
The RT System itself - Status changed from 'new' to 'open'
On Sat\, Sep 20\, 2014 at 5:44 PM\, Dave Mitchell \davem@​iabyn\.com wrote:
So think it most likely that its just malloc() fragmentation.
Huh. So is this "not a bug"\, just unfortunate behaviour?
-- Matthew Horsfall (alh)
On Mon\, Sep 22\, 2014 at 12:24:10PM -0400\, Matthew Horsfall (alh) wrote:
On Sat\, Sep 20\, 2014 at 5:44 PM\, Dave Mitchell \davem@​iabyn\.com wrote:
So think it most likely that its just malloc() fragmentation.
Huh. So is this "not a bug"\, just unfortunate behaviour?
I guess so.
-- This email is confidential\, and now that you have read it you are legally obliged to shoot yourself. Or shoot a lawyer\, if you prefer. If you have received this email in error\, place it in its original wrapping and return for a full refund. By opening this email\, you accept that Elvis lives.
@iabyn - Status changed from 'open' to 'rejected'
Migrated from rt.perl.org#122791 (status was 'rejected')
Searchable as RT122791$