develooper Front page | perl.perl5.porters | Postings from December 2021

Re: v5.35.5 consumes significantly more memory than v5.35.4

Thread Previous | Thread Next
From:
Tony Cook
Date:
December 8, 2021 03:56
Subject:
Re: v5.35.5 consumes significantly more memory than v5.35.4
Message ID:
20211208035537.GT10332@venus.tony.develop-help.com
On Fri, Nov 19, 2021 at 08:47:05AM +0000, Nicholas Clark wrote:
> The implication of clearing that bit is that a block guarded by if (SvOOK(hv))
> can be entered again, and Hugo wrote in review:
> 
>     Someone else definitely needs to look at this. It isn't clear to me that
>     the if (SvOOK) block is safe to reenter - meta looks fine, but HvENAME
>     and HvNAME are less obvious.
> 
> 
> So, we need someone (else) to review the implications of the changes to
> Perl_hv_undef_flags() in commit bb83dff560cc0de9

I don't think it introduces any regressions.

I think the calls to hv_name_set() end up updating PL_strtab correctly
in all cases.

PL_statcache doesn't have all of the effective names for the stash
removed when the primary name is removed, but I don't think that's
harmful, since the names still point at this stash.

valgrind -q ./perl -Ilib -MData::Dumper -MXS::APItest -MDevel::Peek -le \
    'sub Foo::A::quux { print "quux"; } *{"Foo::B::"} = \%Foo::A::; *{"Foo::C::"} = \%Foo::A::; \
     Dump(\%Foo::A::); Foo::A->quux(); Foo::B->quux(); Foo::C->quux(); \
     print Dumper(XS::APItest::stashcache()); undef %Foo::A::; Dump(\%Foo::A::); \
     print Dumper(XS::APItest::stashcache()); Foo::B->quux() '
...
SV = IV(0x1264b878) at 0x1264b888
  REFCNT = 1
  FLAGS = (TEMP,ROK)
  RV = 0x1266b818
  SV = PVHV(0x12780ff0) at 0x1266b818
    REFCNT = 4
    FLAGS = (OOK,SHAREKEYS,OVERLOAD)
    AUX_FLAGS = 0
    ARRAY = 0x0
    KEYS = 0
    FILL = 0
    MAX = 7
    RITER = -1
    EITER = 0x0
    RAND = 0xf12dce47
    NAMECOUNT = -4
    ENAME = "Foo::A", "Foo::C", "Foo::B"
$VAR1 = {
          'Foo::B' => 308721688,
...
          'Foo::C' => 308721688
        };

but I wasn't really aware of effective names when I started looking at
this.

(XS::APItest::stashcache() is a temp function that returns a reference
to PL_stashcache.)

Tony

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