Hello!

Lately I've been looking at V8's heap consumption and tooling around
measuring and tracking it. I see we have a few different ways to do it
and I've been thinking about adding a new one :-). So I thought I'd ask
what you thought first.

Essentially, I want to collect stats about the heap regularly, at
every GC for instance, and then either plot this information over
time, or do some statistics like getting the peak for each space, or
figuring out how fragmented we are, ...etc

So at the moment, to do things like that we can:

  * Use the V8 API or the inspector protocol.

  * Use --trace-gc-verbose to print statistics at every GC.

  * Use --trace-gc-object-stats or --enable-tracing with the
    "v8.gc_stats" category enabled to collect object statistics at every
    mark-compact GC.

  * ... something I missed?

I started using --trace-gc-verbose and it works OK but its output is
not very friendly for tools to consume. And on the other hand, I like
how the TRACE macros work and are used with --trace-gc-object-stats.

So I've been thinking about adding a new trace event that prints heap
statistics, enabled with the existing `v8.gc_stats` tracing category. I
haven't thought about all the details yet, but the current idea is the
following:

- Add a "instant" trace event for the "v8.gc_stats" category for
  every GC, both the scavenger and mark-compact, as opposed to
  --trace-gc-object-stats which triggers only using mark-compact.

- The event could be called "V8.GC_Heap_Stats", to mirror
  "V8.GC_Object_Stats".

- Output JSON with both global and per-space statstics, just like
  GetHeapStatistics() and GetHeapSpaceStatistics() from the V8 API do.

How does this sound? Are there tools (tools/heap-stats?) that would
benefit from this? Or do we already have ways to do this and I've missed
it?

Thanks,
Pierre

-- 
-- 
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev
--- 
You received this message because you are subscribed to the Google Groups 
"v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to