4 ms·
MemLab: An open source framework for finding JavaScript memory leaks
- emptysea 4y agoAh I think this was mentioned in a comment on a previous thread: https://news.ycombinator.com/item?id=29595441 https://news.ycombinator.com/item?id=29595441 Glad to see it finally open sourced!
- lgong 4y agoYup, that's the previous thread :)
- maxloh 4y agoIf there is any memory leaks in a garbage-collected language, isn't it a bug of V8 instead?
- astrange 4y agoYou can just leak memory by leaving references to it around. Sometimes called memory abandonment. With some systems you can pin it and forget to unpin it.
- fithisux 4y agoVery good explanation. I always wondered what is the equivalent of memory leak in a garbage collected language. Are there any tools for this?
- astrange 4y agoWell, there’s the one in the article. Usually each GC implementation comes with its own tools. You can watch process memory in general and see if keeps going up; if it does, it’s someone’s fault.
- fithisux 4y agoMy question exactly.
- latchkey 4y agoMemory leak because of console.log? Wow, news to me. Not that I really ever use it for much since I believe in writing unit tests over outputting logs to the console. But I can see how others might get bitten by this for sure.
- chess_buster 4y agoCan confirm, have been bitten in production. Therefore we have a lint rule that disallows `console.log` for production builds.
- jalino23 4y agoits incredibly difficult to debug memory leak even with dev tools, I will look into this and hope it helps
- Frotag 4y agoI learned recently that Edge has a "Detached Elements" panel that identifies leaked DOM elements and the code / object holding the reference. It basically automates the process of diff'ing heap snapshots.
- buttersbrian 4y agoThat's awesome. Thanks for sharing!
- x-shadowban 4y agoNode heap profiler in chrome is pretty good, often it will show the largest retainers and if your hookes to a live vm (not a snapshot) you can inspect the object and eventually go "oh yeah this array just grows and grows..."
- darepublic 4y agoThe stuff of nightmares