Quantcast
Channel: JavaScriptMVC Forum
Viewing all articles
Browse latest Browse all 3491

CanJS and Memory Leaks

$
0
0
I recently re-read Brian's awesome blog post  "Avoid The Zombie Apocalypse", and I have some questions pertaining to the following closing statement:
It is almost impossible to create a leaking app with CanJS

In my app I have several components that periodically poll for fresh data. One example is a status panel that displays 4 status indicators. It polls the server every 30 seconds for the current status of the 4 main parts of the app and updates the display using live-binding. The polling is accomplished with Ben Alman's doTimeout plugin. 

I have noticed that as the app continues to run, the memory usage slowly increases. I am just starting to learn how to use Chrome Dev Tools to debug memory leaks, but by comparing heap snapshots, I can see that something is leaking. Since I am not very experienced with the tool, I don't yet know how to pinpoint the root cause.

I have extracted the status panel code into a simple fiddle demonstrating the the issue. But since I am not really doing anything crazy in my code (not that I realize at least), I am hoping someone can take a look see if they know what is causing the leak. 

Am I doing something bad in my code? Is it a CanJS issue?


Thanks.



Viewing all articles
Browse latest Browse all 3491

Trending Articles