DEV Community

Cover image for Finding And Fixing Node.js Memory Leaks: A Practical Guide

Finding And Fixing Node.js Memory Leaks: A Practical Guide

Kmaschta on April 16, 2018

Fixing memory leaks may not be not the shiniest skill on a CV, but when things go wrong on production, it's better to be prepared! After reading...
Collapse
 
scroung3d profile image
Scroung3D

Very useful information. Thank you.

Collapse
 
mogery profile image
Gergő Móricz

Reading and writing to the disk comes with a cost, so do other API calls or database requests.

Async writeFile?

Collapse
 
kmaschta profile image
Kmaschta

You're right, it's better! But it will never be as fast as writing in memory.

Collapse
 
mogery profile image
Gergő Móricz

Explanation for people who are new to JS: writeFile is async, a.k.a. it doesn’t leave the execution waiting for the file to be written.

Collapse
 
dangolant profile image
Daniel Golant

"What can't be measured can't be fixed." tooo tru