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
stash <-> @ISA circular ref #11420
Comments
From @cpansproutThere is a circular reference between stashes and their @ISA arrays. The @ISA arrays’ isa magic contains refcounted pointers to the stashes to which they belong. That means a script like this leaks memory: $ perl5.14.0 -e 'warn $$; while(1){ @{"foo::bar::ISA"} = "main"; use Symbol; Symbol::delete_package("foo")}' Should the isa magic be using weak references? The relevant code is in sv.c:S_glob_assign_glob (search for ‘if(mro_changes == 2)’), sv.c:S_glob_assign_ref (at the end of the function) and, of course, in mg.c:Perl_magic_clearisa. Flags: Site configuration information for perl 5.14.0: Configured by sprout at Wed May 11 13:45:58 PDT 2011. Summary of my perl5 (revision 5 version 14 subversion 0) configuration: Locally applied patches: @INC for perl 5.14.0: Environment for perl 5.14.0: |
From jtbraun@CPAN.orgThis is a bug report for perl from jtbraun@CPAN.org, # Test case, see below __END__ for full description foreach my $erase (1,0) { # Get the current process's memory usage (probably only # Print out memory usage if it's changed __END__ The test above creates an array variable named @OTHER or @ISA in the Immediately after the package is created, the stash for that namespace Then the perl process's memory is queried via the external 'ps' The result: non-empty @ISA arrays appear to leak memory. If the @ISA Also included below is some example output, and some Test::LeakTrace Perhaps the special treatment of @ISA in S_gv_magicalize_isa() from The output of the above test from an example run on my machine. Note 1 :: @OTHER (erased) :: 0.58 An example output from Test::LeakTrace's: leaked SCALAR(0x9e34ec0) from leak2.pl line 17. Flags: Site configuration information for perl 5.14.2: Configured by jtbraun at Thu Dec 1 01:10:27 PST 2011. Summary of my perl5 (revision 5 version 14 subversion 2) configuration: Platform: Locally applied patches: @INC for perl 5.14.2: Environment for perl 5.14.2: |
From bitcard@spamwagon.comOn closer inspection, this appears to be a duplicate of #92708? Sorry Jeremy |
The RT System itself - Status changed from 'new' to 'open' |
Migrated from rt.perl.org#92708 (status was 'new')
Searchable as RT92708$
The text was updated successfully, but these errors were encountered: