develooper Front page | perl.perl5.porters | Postings from July 2010

Re: [perl #75176] Symbol::delete_package does not free certain memory associated with package::ISA

Thread Previous | Thread Next
From:
Nicholas Clark
Date:
July 27, 2010 07:25
Subject:
Re: [perl #75176] Symbol::delete_package does not free certain memory associated with package::ISA
Message ID:
20100727142507.GY48531@plum.flirble.org
On Sun, Jul 25, 2010 at 12:57:02PM -0700, webmasters@ctosonline.org wrote:
> This was caused by change 31239/70cd14 which fixes *ISA=[] to call mro_isa_changed_in.
> 
> The actual underlying cause is explained in mro?s manpage, under mro::get_isarev:
> 
>       Currently, this list only grows, it never shrinks.  This was a
>       performance consideration (properly tracking and deleting isarev
>       entries when someone removes an entry from an @ISA is costly, and it
>       doesn't happen often anyways).
> 
> If it doesn?t happen often, then the cost will not be incurred very often.
> 
> Normally, the list of parent classes is cached, so Perl_mro_isa_changed_in can be made to compare it with the new list and delete isarev entries as appropriate. This may not be very efficient, but, again, it won?t happen very often, as the existing cached list will normally be empty.
> 
> S_hfreeentries is the only other routine that clears the cache, so I can make that remove isarev entries, too.
> 
> If I write a patch for this, is there any remote possibility of its being applied, or would it be a waste of time?

The documentation you quoted continues with:

    The fact that a class which no longer truly "isa" this class at
    runtime remains on the list should be considered a quirky
    implementation detail which is subject to future change.  It shouldn't
    be an issue as long as you're looking at this list for the same
    reasons the core code does: as a performance optimization over having
    to search every class in existence.


Yes, finding an efficient way to fix this would be useful and welcomed.

Nicholas Clark

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