You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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_gc option to node.js?
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, v8 now has support for space analysis via GetHeapSpaceStatistics. 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 v8 module called getHeapSpaceStatistics() 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.
Activity
ofrobots commentedon Jun 29, 2015
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?yepitschunked commentedon Jun 30, 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.
bnoordhuis commentedon Jun 30, 2015
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.
bripkens commentedon Dec 28, 2015
@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.
bripkens commentedon Dec 29, 2015
The v8 sources confirm that heap statistics include
new_space,old_space,map_space,code_space, andlarge_object_space.bnoordhuis commentedon Dec 29, 2015
@bripkens
v8.getHeapSpaceStatistics()sounds like a reasonable addition to me.bripkens commentedon Dec 29, 2015
great, I'll get right to it then :)
1 remaining item
v8,src: expose statistics about heap spaces
v8,src: expose statistics about heap spaces
v8,src: expose statistics about heap spaces
v8,src: expose statistics about heap spaces
v8,src: expose statistics about heap spaces
v8,src: expose statistics about heap spaces