Skip to content

Commit 2efaaf6

Browse files
committed
guide: apply review suggestions
1 parent f4990d9 commit 2efaaf6

File tree

5 files changed

+15
-11
lines changed

5 files changed

+15
-11
lines changed

locale/en/docs/guides/diagnostics/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ These guides were created in the [Diagnostics Working Group](https://github.com/
99
with the objective to provide a guidance when diagnosing an issue
1010
in the user application.
1111
The documentation project is organized based on user journey.
12-
Those journeys are coherent set of step-by-step procedures,
12+
Those journeys are a coherent set of step-by-step procedures,
1313
that a user follows for problem determination of reported issues.
1414

1515
This is the available set of diagnostics guides:

locale/en/docs/guides/diagnostics/memory/index.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ restarts make certain requests to fail _(load balancer responds with 502)_.
3636
* Process restarts due to the memory exhaustion and request are dropped on the
3737
floor
3838
* Increased GC activity leads to higher CPU usage and slower response time
39-
* Increased memory swapping slows down the process
39+
* GC blocking the Event Loop causing slowness
40+
* Increased memory swapping slows down the process (GC activity)
4041
* May not have enough available memory to get a Heap Snapshot
4142

4243
### Debugging

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ layout: docs.hbs
88
There's a lot to learn about how the garbage collector works, but if you learn
99
one thing it's that when GC is running, your code is not.
1010

11-
You may want to know how often and how long the garbage collection is running.
11+
You may want to know how often and how long the garbage collection is running,
12+
and what is the outcome.
1213

1314
## Runnig with garbage collection traces
1415

@@ -20,7 +21,8 @@ $ node --trace_gc app.js
2021
```
2122

2223
You might want to avoid getting traces from the entire lifetime of your
23-
process running on a server. In that case, set the flag from within the process.
24+
process running on a server. In that case, set the flag from within the process,
25+
and switch it off once the need for tracing is over.
2426

2527
Here's how to print GC events to stdout for one minute.
2628

@@ -92,7 +94,7 @@ This is how to interpret the trace data (for the second line):
9294

9395
## Using performance hooks to trace garbage collection
9496

95-
For Node.js v8.5.0 or later, you can use [performance hooks][] to trace
97+
In Node.js, you can use [performance hooks][] to trace
9698
garbage collection.
9799

98100
```js
@@ -177,7 +179,7 @@ For more information, you can refer to
177179

178180
A. How to get context of bad allocations
179181
1. Suppose we observe that the old space is continously increasing.
180-
2. But due to heavy gc, the heap roof is not hit, but the process is slow.
182+
2. But due to heavy gc, the heap maximum is not hit, but the process is slow.
181183
3. Review the trace data and figure out how much is the total heap before and
182184
after the gc.
183185
4. Reduce `--max-old-space-size` such that the total heap is closer to the
@@ -187,7 +189,7 @@ limit.
187189

188190
B. How to assert whether there is a memory leak when heap growth is observed
189191
1. Suppose we observe that the old space is continously increasing.
190-
2. Due to heavy gc, the heap roof is not hit, but the process is slow.
192+
2. Due to heavy gc, the heap maximum is not hit, but the process is slow.
191193
3. Review the trace data and figure out how much is the total heap before and
192194
after the gc.
193195
4. Reduce `--max-old-space-size` such that the total heap is closer to the
@@ -196,7 +198,7 @@ limit.
196198
6. If it hits OOM, increment the heap size by ~10% or so and repeat few times.
197199
If the same pattern is observed, it is indicative of a memory leak.
198200
7. If there is no OOM, then freeze the heap size to that value - A packed heap
199-
reduces memory footprint and compation latency.
201+
reduces memory footprint and compaction latency.
200202

201203
C. How to assert whether too many gcs are happening or too many gcs are causing
202204
an overhead

locale/en/docs/guides/diagnostics/memory/using-heap-profiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ node --inspect index.js
3838

3939
> `--inspect-brk` is an better choice for scripts.
4040
41-
Connect to the dev-tools instance and then:
41+
Connect to the dev-tools instance in chrome and then:
4242

4343
* Select `memory` tab
4444
* Select `Allocation instrumentation timeline`

locale/en/docs/guides/diagnostics/memory/using-heap-snapshot.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ layout: docs.hbs
66
# Using Heap Snapshot
77

88
You can take a Heap Snapshot from your running application and load it into
9-
Chrome Developer Tools to inspect certain variables or check retainer size.
9+
[Chrome Developer Tools][] to inspect certain variables or check retainer size.
1010
You can also compare multiple snapshots to see differences over time.
1111

1212
## Warning
1313

14-
To create a snapshot, all other work in your main thread is stopped.
14+
When creating a snapshot, all other work in your main thread is stopped.
1515
Depending on the heap contents it could even take more than a minute.
1616
The snapshot is built in memory, so it can double the heap size, resulting
1717
in filling up entire memory and then crashing the app.
@@ -158,3 +158,4 @@ Practice capturing heap snapshots and finding memory leaks with
158158
[load button image]: /static/images/docs/guides/diagnostics/load-snapshot.png
159159
[comparison image]: /static/images/docs/guides/diagnostics/compare.png
160160
[heapsnapshot exercise]: https://github.com/naugtur/node-example-heapdump
161+
[Chrome Developer Tools]: https://developer.chrome.com/docs/devtools/

0 commit comments

Comments
 (0)