Repository navigation
More getHeapStatistics stats #2079
Description
Activity
Can you elaborate on what you mean by 'visibility .. from user code'? What would you like to see that is not available today when you pass the
--trace_gcoption to node.js?- addedv8 engineIssues and PRs related to the V8 dependency.Issues and PRs related to the V8 dependency.feature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Jun 29, 2015 You're right, trace_gc gives us all the stats we want. However, this gets printed out to stdout/(err?) directly by v8. It would be nice to be able to query them from Javascript as well, so we don't have to write a separate trace_gc-output-parser. We're already tracking a variety of counters and other stats in our main app process, and it'd be convenient to include VM stats like these in there as well.
Per-space statistics are not currently exposed through V8's C++ API (and therefore not through the v8 module's API.) Someone - you? - would first have to take it up with V8, either through a feature request or a CL.
Tracking GC time is possible with the GC prologue and epilog callbacks. v0.11 exposed that functionality to JS land for a while but I removed it again in dab6f68 for reasons outlined in the commit log.
@bnoordhuis: We are currently looking into the same feature for a monitoring product. As far as I understand,
v8now has support for space analysis viaGetHeapSpaceStatistics. Would you be willing to accept a feature which adds support for heap space analysis?I am thinking about the following: Expose a function as part of the
v8module calledgetHeapSpaceStatistics()which returns the statistics for all spaces. So basically iterating through all spaces, aggregating the results and returning them.If such an interest exists, I'd willing to try to contribute this.
The v8 sources confirm that heap statistics include
new_space,old_space,map_space,code_space, andlarge_object_space.@bripkens
v8.getHeapSpaceStatistics()sounds like a reasonable addition to me.great, I'll get right to it then :)
1 remaining item
- added a commit that references this issue
on Jan 18, 2016 - added a commit that references this issue
on Apr 2, 2016 - added a commit that references this issue
on Jan 13, 2017 - added a commit that references this issue
on Jan 24, 2017 - added a commit that references this issue
on Feb 1, 2017 - added a commit that references this issue
on Jul 27, 2026
Coming from running JVM services, it'd be great to have a more detailed view into old-space/new-space usage over time, time spent in GC, etc.
I noticed these are being tracked/printed out by v8 when --trace_gc is on (https://github.com/v8/v8-git-mirror/blob/master/src/heap/gc-tracer.cc) but there's no visibility into this from user code. Is there some way to get at this information?