JQuery Memory Leak

JQuery Memory Leak

Hi JQuery,

 

First of all thank you for the JQuery libraries and big range of UI components.

 

I am using following libraries

1.       jquery-1.4.2.min.js

2.       jquery-ui-1.8.1.custom.min.js

3.       jquery.ui.core.js

 

I have generated a JQuery page which has

1.       Date Navigator – Made singleton.

2.       Accordion

3.       Planner – Custom UI Widget

4.       Magnets - Custom UI Widget

5.       Context Menu widget

 

The page is generated dynamically and communicating with backend using GWT RPC calls.

Planner is the custom widget which is rendering the planning calendar as DIVs and Spans.

Magnet is the small SPAN with some information to be displayed on the top of planner using the X-Y coordinates. There will be 40-50 magnets per page.

I have exposed events in planner widget like createMagnet, deleteMagnet, updateMagnet etc. There I am creating the SPAN appending in planner DIV and then applying magnet widget on it.

The magnets are Draggable/Resizable/double clickable on planner.

 

I have properly implemented destroy method of planner to unbind all the events properly.

 

W.r.t above points I am facing following problem

 

My application’s memory is leaking by 2MB-5MB per page load. I have tried DRIP to inspect the leak but the objects are getting cleared. I don’t know why this is happening.

One more point want to highlight is I have a javascript object per magnet which is kept in JQuery cache. But I am deleting this object before loading the page every time.

 

Please help.
 
Thanks in advance.
Kailas Kore