Conversation
Original commit message:
[heap profiler] Add is_live field to AllocationProfile::Sample
When using kSamplingIncludeObjectsCollectedByMajorGC/MinorGC flag, samples for collected objects are retained but callers had no way to distinguish live from dead objects.
Add is_live to expose this information.
Change-Id: I2e930644348ff942caa4b192a127c5baa05bbfef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7603535
Reviewed-by: Dominik Inführ <dinfuehr@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#105698}
Refs: v8/v8@0f024d4
|
Review requested:
|
|
Is this ABI-compatible? |
This is ABI compatible since the commit adds a new field |
|
My understanding of structs is that adding fields cannot be ABI-compatible because it changes the size of the object. @nodejs/cpp-reviewers |
|
Yes the struct size does matter for ABI compatibility. But |
|
Our V8 header and all the symbols are exposed, so regardless of whether Node.js uses them internally, user land addons can already rely on them (and I think there are probably a long tail of addons or libraries that do, e.g. #61102, note that we don't use the default platform internally) |
|
That's clear! I understand now how backporting in a patch release could break addons. |
Original commit message:
Refs: v8/v8@0f024d4
Motivation and changes
Continues the heap profiler improvements started in #62201 and #62273.
V8's
StartSamplingHeapProfileraccepts GC flags that retain samples even after the objects are GC'd. However, there was no way to distinguish whether a sampled allocation was still alive or had already been freed.With this commit, we can:
As a follow-up,
SerializeHeapProfilewill be updated to include per-node freed object size based onis_livefield from GetSamples().