develooper Front page | perl.perl5.porters | Postings from January 2006

Re: [perl #38384] Memory leak printing large hash-references

Thread Previous | Thread Next
From:
Gisle Aas
Date:
January 31, 2006 11:38
Subject:
Re: [perl #38384] Memory leak printing large hash-references
Message ID:
lrwtggjihg.fsf@caliper.activestate.com
"paul.boutros@utoronto.ca (via RT)" <perlbug-followup@perl.org> writes:

> I appear to have found a memory leak in perl 5.8.7 and possibly 5.6.2
> that occurs when printing out compound-hashes using tabs.

This is not a memory leak.  The reason perl allocates memory during
printing is that it converts all the 0 values in the hashes to strings
and stores these.  This upgrades your SvIV structs containing 0 into
the much larger SvPV structs containing both 0 and "0" (see [1]).

--Gisle

[1] http://search.cpan.org/src/GAAS/illguts-0.09/index.html#sviv

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About