r/javascript • • Aug 10 '24

Common Causes of Memory Leaks in JavaScript

https://www.trevorlasn.com/blog/common-causes-of-memory-leaks-in-javascript
0 Upvotes

4 comments sorted by

5

u/shgysk8zer0 Aug 10 '24

Looks fairly detailed, but... V8 != JS. Node != JS. Title is inaccurate.

-1

u/ironykarl Aug 11 '24

You must not have even read the article. Parts of the article specifically pertain to v8, and that's cuz they're specifically about profiling.

The entire rest of the article is examples, and all of the examples (except the last one—which the author notes) will create memory leaks, regardless of which JS implementation you're using.

2

u/VIKTORVAV99 Aug 11 '24

I did read the article and it’s full of stuff like this:

However, JavaScript’s garbage collector is generally effective at cleaning up memory once references are no longer needed.

There is no JavaScript garbage collector, they are all platform specific.

1

u/ironykarl Aug 11 '24

OK. Agreed that that's a reasonable nit to pick. 

I still think the code examples are good, but you're right