Skip to content

Commit e9a5053

Browse files
MaledongRafaelGSS
Maledong
andauthored
doc: Fix for some statements (#4780)
1. 'trace-gc' can be also 'trace_gc'. However if you see 'node --v8-options' the standard should be '--trace-gc', and this is the fix to make them in union. 2. 'flags' won't be timestamps but additional information about GC Co-authored-by: Rafael Gonzaga <[email protected]>
1 parent 140a62c commit e9a5053

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

locale/en/docs/guides/diagnostics/memory/using-gc-traces.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ function summary () {
6363
## Running with garbage collection traces
6464

6565
You can see traces for garbage collection in console output of your process
66-
using the `--trace_gc` flag.
66+
using the `--trace-gc` flag.
6767

6868
```console
69-
$ node --trace_gc script.mjs
69+
$ node --trace-gc script.mjs
7070
```
7171

7272
> Note: you can find the source code of this [exercise][]
@@ -88,9 +88,10 @@ Total: 1000000 entries
8888
Hard to read? Maybe we should pass in review a few concepts
8989
and explain the outputs of the `--trace-gc` flag.
9090

91-
### Examining a trace with `--trace_gc`
91+
### Examining a trace with `--trace-gc`
9292

93-
The `--trace-gc` flag outputs all garbage collection events in the console.
93+
The `--trace-gc` (or `--trace_gc`, either is fine) flag outputs all garbage collection
94+
events in the console.
9495
The composition of each line can be described as:
9596

9697
```bash
@@ -312,11 +313,11 @@ The `v8` module exposes an API to put flags on the fly.
312313
```js
313314
import v8 from 'v8';
314315

315-
// enabling trace_gc
316-
v8.setFlagsFromString('--trace_gc');
316+
// enabling trace-gc
317+
v8.setFlagsFromString('--trace-gc');
317318

318-
// disabling trace_gc
319-
v8.setFlagsFromString('--notrace_gc');
319+
// disabling trace-gc
320+
v8.setFlagsFromString('--notrace-gc');
320321
```
321322

322323
### Using performance hooks
@@ -375,7 +376,7 @@ PerformanceEntry {
375376
| startTime | The high-resolution millisecond timestamp is marking the starting time of the Performance Entry. |
376377
| duration | The total number of milliseconds elapsed for this entry. |
377378
| kind | The type of garbage collection operation that occurred. |
378-
| flags | The high-resolution millisecond timestamp is marking the starting time of the Performance Entry. |
379+
| flags | The additional information about GC. |
379380

380381
For more information, you can refer to
381382
[the documentation about performance hooks][performance hooks].

0 commit comments

Comments
 (0)