turuslan / HackTimer

MIT License
491 stars 93 forks source link

excessive memory leaking #11

Open seiyria opened 8 years ago

seiyria commented 8 years ago

over time, if used for a really long time (8-36 hours) this causes a webpage to become incredibly slow. tested with and without on a project and the speed does not drop if hacktimer is not included.

turuslan commented 8 years ago

thank you for reporting. i will try to find out and fix it.

timotheeg commented 8 years ago

FYI: I reckon it's because the callback map is not cleared on successful setTimeout callback. For setTimeouts, the callback map should be cleared even if clearTimeout is not called explicitly.

turuslan commented 8 years ago

Thanks to @timotheeg, there was such a mistake of not deleting unused timeout entries. Commit e11f3ed2292062ee1e1aafe3510802a889ea6f96 must fix it.

seiyria commented 8 years ago

I'll give this a try sometime later and see if it's still causing problems. If so, I'll let you know. Thanks!

turuslan commented 8 years ago

In commit e11f3ed2292062ee1e1aafe3510802a889ea6f96 I forgot to update silent version (HackTimer.silent.min.js) (issue 13) that you used (package.json). So it was not fixed that time. Now it is updated (8e2fef9429ec427a54d8b407a2f1130b5a811098, c06bbc674e3c49d9c250e5890724cbf007c53388).