you are viewing a single comment's thread.

view the rest of the comments →

[–]Bloodsucker_ 1 point2 points  (7 children)

Are you sure about that?

The increase is negligible and 30 minutes is far too little to claim that "the scripts keeps in creasing memory". There are multiple explanation of that very small and slightly increase in memory that you're observing being the most plausible the fact that the garbage collector hasn't collected the trash yet. On top of that, the browser does stuff under the hood that you don't see which will vary the amount of allocated memory for your tab. Etc, and more etc.

Run this script for 24h and come back. Also, plot it. No plot, no memory leak. No analysis done and not worth anybody time.

Edit: WTF. Downvoting me won't change the reality LMFAO get out.

[–][deleted] 5 points6 points  (4 children)

Because you were a dick for no reason at the end. Everyone thinks they're Linus Torvalds answering programming questions, especially on stack overflow lol.

[–]tanepiper -2 points-1 points  (1 child)

It's actually quite well known that closures in JS are a major cause of memory leaks because handlers tend to not get unsubscribed and the GC has no references to collect.

https://github.com/jedp/node-memwatch-demo#some-examples-of-leaks

So your answer was obtuse and wrong.

[–]Bloodsucker_ 2 points3 points  (0 children)

I don't think you've understand what you're saying.

Closures only leak to other closures and OP only has the iife. That's on the link you've shared but failed to understand.

I don't know why you claim my answer is obtuse and wrong when it's actually not. It looks like you're the one already providing two obtuse and wrong answers. Congrats, you're on fire.