views:

70

answers:

2

Hi Everyone,

Does any body know the memory usage and possible memory leaks with javascript functions settimeout and setinterval?

Thank you,

Krishna

A: 

IE7 might (and probably does) have leaks. chrome is less likely but its always possible. js engines are complex. You might also be creating unknown numbers of timeouts and intervals that could eat up some memory.

Scott M.
+1  A: 

It's important to use clearTimeout() on any timers that run and then stop. Otherwise you're asking for memory leakage, especially if you're creating lots of timers by using loops.

If you clear them, it would take more than a handful of timers to cause any noticeable slowdowns.

Trafalmadorian