Skip to content

Commit

Permalink
Revert "Expose new GC types introduced in v8 version 4.6"
Browse files Browse the repository at this point in the history
  • Loading branch information
hhellyer authored and mattcolegate committed Sep 29, 2017
1 parent 1bbdd93 commit c476c51
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,13 +238,7 @@ Emitted every 5 seconds, summarising sample based information of the event loop
Emitted when a garbage collection (GC) cycle occurs in the underlying V8 runtime.
* `data` (Object) the data from the GC sample:
* `time` (Number) the milliseconds when the sample was taken. This can be converted to a Date using `new Date(data.time)`.
* `type` (String) the type of GC cycle, either:
- `'M'`: MarkSweepCompact, aka "major"
- `'S'`: Scavenge, aka "minor"
- `'I'`: IncrementalMarking, aka "incremental" (only exists on node 5.x
and greater)
- '`W'`: ProcessWeakCallbacks, aka "weakcb" (only exists on node 5.x
and greater)
* `type` (String) the type of GC cycle, either 'M' or 'S'.
* `size` (Number) the size of the JavaScript heap in bytes.
* `used` (Number) the amount of memory used on the JavaScript heap in bytes.
* `duration` (Number) the duration of the GC cycle in milliseconds.
Expand Down
12 changes: 1 addition & 11 deletions src/plugins/node/gc/nodegcplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,17 +115,7 @@ void afterGC(v8::Isolate *isolate, GCType type, GCCallbackFlags flags) {
gcRealEnd = GetRealTime();

// GC type
const char *gcType = NULL;
switch (type) {
case kGCTypeMarkSweepCompact: gcType = "M"; break;
case kGCTypeScavenge: gcType = "S"; break;
#if NODE_VERSION_AT_LEAST(5, 0, 0)
case kGCTypeIncrementalMarking: gcType = "I"; break;
case kGCTypeProcessWeakCallbacks: gcType = "W"; break;
#endif
// Should never happen, but call it minor if type is unrecognized.
default: gcType = "S"; break;
}
const char *gcType = (type == kGCTypeMarkSweepCompact) ? "M" : "S";

// GC heap stats
HeapStatistics hs;
Expand Down

0 comments on commit c476c51

Please sign in to comment.