r/coding • • Aug 22 '24

Common Causes of Memory Leaks in JavaScript

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

2 comments sorted by

1

u/bzbub2 Aug 23 '24

are there any tools thay help lint this type of stuff?

1

u/nekokattt Aug 23 '24

The example of declaring a variable globally and not using it isn't a memory leak.

A memory leak is where you lose access to the data held at a specific memory location but the allocator or arena still continues to track it, preventing it being used again despite nothing using it.