Skip to content

doc: Fix for some statements #4780

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions locale/en/docs/guides/diagnostics/memory/using-gc-traces.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,10 @@ function summary () {
## Running with garbage collection traces

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

```console
$ node --trace_gc script.mjs
$ node --trace-gc script.mjs
```

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

### Examining a trace with `--trace_gc`
### Examining a trace with `--trace-gc`

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

```bash
Expand Down Expand Up @@ -312,11 +313,11 @@ The `v8` module exposes an API to put flags on the fly.
```js
import v8 from 'v8';

// enabling trace_gc
v8.setFlagsFromString('--trace_gc');
// enabling trace-gc
v8.setFlagsFromString('--trace-gc');

// disabling trace_gc
v8.setFlagsFromString('--notrace_gc');
// disabling trace-gc
v8.setFlagsFromString('--notrace-gc');
```

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

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