| Issue 2137: | Unable to clean up fullCalendar memory usage with destroy. | |
| 1 person starred this issue and may be notified of changes. | Back to list |
This bug can be reproduced by going to: http://jsfiddle.net/68fYv/3/ Current Behavior: I create a fullCalendar on a div, then call fullCalendar('destroy'); on that div. Chrome Heap Profiler reports hundreds of lose divs are unreachable by still referenced in the background. Memory usage grows rapidly. Desired Behavior: Calling fullCalendar('destroyed') or calling 'fullCalendar(options)' on the same div, will clean up resources for the previous instance. Easy steps for verification: Using Chrome, go to 'Window -> Task Manager' and run the above jsfiddle example. Watch the memory usage explode. Is there a recommended way to clean up fullCalendar instances that I'm not following?
Jun 10, 2014
I fixed a leak due to have selectable:true (or droppable:true)... https://github.com/arshaw/fullcalendar/commit/914b28a046ad56ec307f423de6d562305742d240
Status:
Implemented
Jun 10, 2014
before the bugfix...
Jun 10, 2014
after the bugfix...
Jun 10, 2014
This test initializes/destroys the calendar 100 times with a 200ms delay. In the repo, it it under tests/memory_leak.html Handlers attached to the `window` and `document` were not being cleaned up, so references to the Calendar object were sticking around, as well as their references to the detached DOM nodes. You'll notice that overall memory usage still isn't that great in Chrome. But whereas before it kept going up and up and up with no limit, now it seems to cap at ~25mb, then go back down, and repeat. I believe this is due to circular references of objects, due to the way I do "parasitic inheritance" (where objects uses closures and a cached reference to `this` in a variable called `t`). Chrome seems to only deal with the circular references when it reaches the 25mb cap. If the project began to use the standard style classical inheritance, I bet GC would be much more efficient.
Jun 10, 2014
The main victory here is that the heap size stays at ~1mb where before it would go >35mb and higher
Jun 11, 2014
Issue 2167 has been merged into this issue.
Jun 15, 2014
this issue has been addressed and version 2.0.1 has been released: http://arshaw.com/fullcalendar/download/
Status:
Released
|
|
| ► Sign in to add a comment |
Labels: Type-Bug