Skip to content

Commit c476c51

Browse files
hhellyermattcolegate
authored andcommitted
Revert "Expose new GC types introduced in v8 version 4.6"
1 parent 1bbdd93 commit c476c51

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

README.md

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,7 @@ Emitted every 5 seconds, summarising sample based information of the event loop
238238
Emitted when a garbage collection (GC) cycle occurs in the underlying V8 runtime.
239239
* `data` (Object) the data from the GC sample:
240240
* `time` (Number) the milliseconds when the sample was taken. This can be converted to a Date using `new Date(data.time)`.
241-
* `type` (String) the type of GC cycle, either:
242-
- `'M'`: MarkSweepCompact, aka "major"
243-
- `'S'`: Scavenge, aka "minor"
244-
- `'I'`: IncrementalMarking, aka "incremental" (only exists on node 5.x
245-
and greater)
246-
- '`W'`: ProcessWeakCallbacks, aka "weakcb" (only exists on node 5.x
247-
and greater)
241+
* `type` (String) the type of GC cycle, either 'M' or 'S'.
248242
* `size` (Number) the size of the JavaScript heap in bytes.
249243
* `used` (Number) the amount of memory used on the JavaScript heap in bytes.
250244
* `duration` (Number) the duration of the GC cycle in milliseconds.

src/plugins/node/gc/nodegcplugin.cpp

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,7 @@ void afterGC(v8::Isolate *isolate, GCType type, GCCallbackFlags flags) {
115115
gcRealEnd = GetRealTime();
116116

117117
// GC type
118-
const char *gcType = NULL;
119-
switch (type) {
120-
case kGCTypeMarkSweepCompact: gcType = "M"; break;
121-
case kGCTypeScavenge: gcType = "S"; break;
122-
#if NODE_VERSION_AT_LEAST(5, 0, 0)
123-
case kGCTypeIncrementalMarking: gcType = "I"; break;
124-
case kGCTypeProcessWeakCallbacks: gcType = "W"; break;
125-
#endif
126-
// Should never happen, but call it minor if type is unrecognized.
127-
default: gcType = "S"; break;
128-
}
118+
const char *gcType = (type == kGCTypeMarkSweepCompact) ? "M" : "S";
129119

130120
// GC heap stats
131121
HeapStatistics hs;

0 commit comments

Comments
 (0)