• 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
..
api Loading commit data...
asmjs Loading commit data...
ast Loading commit data...
base Loading commit data...
builtins Loading commit data...
codegen Loading commit data...
common Loading commit data...
compiler Loading commit data...
compiler-dispatcher Loading commit data...
d8 Loading commit data...
date Loading commit data...
debug Loading commit data...
deoptimizer Loading commit data...
diagnostics Loading commit data...
execution Loading commit data...
extensions Loading commit data...
flags Loading commit data...
handles Loading commit data...
heap Loading commit data...
ic Loading commit data...
init Loading commit data...
inspector Loading commit data...
interpreter Loading commit data...
json Loading commit data...
libplatform Loading commit data...
libsampler Loading commit data...
logging Loading commit data...
numbers Loading commit data...
objects Loading commit data...
parsing Loading commit data...
profiler Loading commit data...
protobuf Loading commit data...
regexp Loading commit data...
roots Loading commit data...
runtime Loading commit data...
sanitizer Loading commit data...
snapshot Loading commit data...
strings Loading commit data...
tasks Loading commit data...
third_party Loading commit data...
torque Loading commit data...
tracing Loading commit data...
trap-handler Loading commit data...
utils Loading commit data...
wasm Loading commit data...
zone Loading commit data...
DEPS Loading commit data...
DIR_METADATA Loading commit data...
OWNERS Loading commit data...