Crash analysis can find heap stats on the stack when OOM crashes occur (see Heap::RecordStats in v8/src/heap/heap.cc) but a developer looking at crash dumps cannot because the compiler optimizes them away. There is also some risk that a sufficiently advanced compiler might optimize them away even more fully, making them no longer present in crash dumps.
And, if the symbol was guaranteed valid then we could find the heap stats using the debug information instead of using heuristics.
Anyway, we should use base::debug::Alias(&heapstats). It's a good thing and it's practically free (just a call to a NOP function).
I would have added the call myself but v8 doesn't have a 'base' and I don't know where it needs to be put. It needs to be added carefully so that the compiler can't optimize away the call.
Comment 1 by hablich@chromium.org
, Apr 19 2018Labels: -Type-Bug Type-Feature
Owner: yangguo@chromium.org
Status: Assigned (was: Untriaged)