Skip to content

Commit a2bf9e6

Browse files
tony-goRafaelGSS
authored andcommitted
doc: fix typos
1 parent 35cd876 commit a2bf9e6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

documentation/memory/step3/using_gc_traces.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ Now, try to it for 100mb:
189189
node --trace-gc --max-old-space-size=100 script.mjs
190190
```
191191

192-
You should exeprience something similar, the only difference will be the last GC trace that should be last GC trace that contains a bigger heap size.
192+
You should experience something similar, the only difference should be that the last GC trace will contain a bigger heap size.
193193

194194
```bash
195195
<--- Last few GCs --->
@@ -211,7 +211,7 @@ How do you assert whether too many garbage collections are happening or causing
211211

212212
## Fix the leak
213213

214-
Now let's fix the leak. Instead of using a object to store our entries we could use a file.
214+
Now let's fix the leak. Instead of using an object to store our entries, we could use a file.
215215

216216
Let's modify our script a bit:
217217

@@ -251,7 +251,7 @@ async function summary () {
251251
})();
252252
```
253253

254-
Using a `Set` to store data is not a bad practice at all, you should just care about the memory footprint of your program.
254+
Using a `Set` to store data is not a bad practice at all; you should just care about the memory footprint of your program.
255255

256256
> Note: you can find the source code of this exercice in the [Node.js Diagnostics repository](https://github.com/nodejs/diagnostics/tree/main/documentation/memory/step3/exerice).
257257
@@ -262,12 +262,12 @@ node --trace-gc script-fix.mjs
262262
```
263263

264264
You should observe two things:
265-
* the Mark-sweep events appears less frequently
266-
* the memory footprint doesn't exceed 25mb versus more than 130mb with the first script.
265+
* Mark-sweep events appear less frequently
266+
* the memory footprint doesn't exceed 25MB versus more than 130MB with the first script.
267267

268-
It makes a lot of sense as the new version put less pressure on the memory than the first one.
268+
It makes a lot of sense as the new version puts less pressure on the memory than the first one.
269269

270-
**Takeway**: What do you think about improving this script? You probably see that the new version of the script is slow. What if we use a `Set` again and write its content into a file only when the memory reach a certain size?
270+
**Takeaway**: What do you think about improving this script? You probably see that the new version of the script is slow. What if we use a `Set` again and write its content into a file only when the memory reaches a specific size?
271271

272272
> (`getheapstatistics`)[https://nodejs.org/dist/latest-v16.x/docs/api/v8.html#v8getheapstatistics] API could help you.
273273

0 commit comments

Comments
 (0)