• Peter Marshall's avatar
    [cpu-profiler] Clear the CodeMap after the last profile to stop leak · 73a94290
    Peter Marshall authored
    We kept the CodeMap filled with entries between profiles, even in
    kLazyLogging mode which will re-fill the CodeMap when profiling starts
    again. See the bug for more details.
    
    This fix manually clears the CodeMap after the last profile is deleted.
    We already call DisableLogging() when the last profile is stopped. At
    this point we still need the CodeMap alive because the profile object
    we expose via the API is backed by the CodeEntry objects in the CodeMap.
    Once the last profile is deleted though, we can empty the CodeMap.
    
    There is still another bug, which is that we never delete CodeEntry
    objects for deleted code, as there are no CodeDeleteEvents from the GC.
    We will work on that separately, but this fix should stop those leaks
    accumulating between profiles as we wipe the CodeMap entirely between
    profiles (at least for kLazyLogging mode). kEagerLogging mode still has
    this problem and will only be fixed by introducing CodeDelete events or
    similar.
    
    Bug: v8:11051
    Change-Id: Iab9570747d17c657e6e318d434f935af8047d05f
    Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2491033
    Commit-Queue: Peter Marshall <petermarshall@chromium.org>
    Reviewed-by: 's avatarSimon Zünd <szuend@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#70792}
    73a94290
Name
Last commit
Last update
build_overrides Loading commit data...
custom_deps Loading commit data...
docs Loading commit data...
gni Loading commit data...
include Loading commit data...
infra Loading commit data...
samples Loading commit data...
src Loading commit data...
test Loading commit data...
testing Loading commit data...
third_party Loading commit data...
tools Loading commit data...
.clang-format Loading commit data...
.clang-tidy Loading commit data...
.editorconfig Loading commit data...
.flake8 Loading commit data...
.git-blame-ignore-revs Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
.gn Loading commit data...
.vpython Loading commit data...
.ycm_extra_conf.py Loading commit data...
AUTHORS Loading commit data...
BUILD.gn Loading commit data...
CODE_OF_CONDUCT.md Loading commit data...
COMMON_OWNERS Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
ENG_REVIEW_OWNERS Loading commit data...
INFRA_OWNERS Loading commit data...
INTL_OWNERS Loading commit data...
LICENSE Loading commit data...
LICENSE.fdlibm Loading commit data...
LICENSE.strongtalk Loading commit data...
LICENSE.v8 Loading commit data...
MIPS_OWNERS Loading commit data...
OWNERS Loading commit data...
PPC_OWNERS Loading commit data...
PRESUBMIT.py Loading commit data...
README.md Loading commit data...
S390_OWNERS Loading commit data...
WATCHLISTS Loading commit data...
codereview.settings Loading commit data...