in reply to Re^2: Memory usage of a "sub" in mod_perl
in thread Memory usage of a "sub" in mod_perl
and then undef $page->{html}. Shouldn't "undef" be enough?
That depends upon what that hash entry actually is. If it is a reference (or something containing a reference) to data which is held elsewhere, you just clear that slot from the reference, but not the referenced data.
Consider:
perl -le '$foo = "bar"; $h->{foo} = \$foo; undef $h->{foo}; print "foo + :$foo:"' foo :bar:
which is different to
perl -le '$foo = "bar"; $h->{foo} = \$foo; undef ${$h->{foo}}; print " +foo :$foo:"' foo ::
where the referenced data is cleared.
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Memory usage of a "sub" in mod_perl
by diego_de_lima (Beadle) on May 23, 2008 at 20:09 UTC | |
by shmem (Chancellor) on May 23, 2008 at 20:26 UTC |