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
Tony Cook
December 8, 2021 03:56
Re: v5.35.5 consumes significantly more memory than v5.35.4
Message ID:
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
  RV = 0x1266b818
  SV = PVHV(0x12780ff0) at 0x1266b818
    REFCNT = 4
    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

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


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About