jQWidgets Forums
jQuery UI Widgets › Forums › Grid › Potential memory leak in jqxGrid ?
Tagged: javascript grid, jquery grid, jqwidgets grid
This topic contains 9 replies, has 3 voices, and was last updated by Peter Stoev 9 years, 5 months ago.
-
Author
-
Hi,
Please investigate the following, it might be a memory leak within the jqxGrid code. The “Chrome” memory profiler is giving me strong hints in that direction.
In “jqxgrid.js” on line 9590 you register an event handler for “selectstart” like this:
this.addHandler($(document), 'selectstart.' + this.element.id, function (event) { if (self.__drag === true) { return false; } });
I can not find any place where this event handler gets removed, and indeed Chrome memory profiler insists that it survives “jqxGrid(‘destroy’)”. The problem is that via closure it also prevents other memory from getting garbage collected.
Regards,
StephanHi Stephan,
We would look into that and will test whether your report is correct, but we would not discuss the code of jqxGrid and also please keep in mind that sharing a code from our widgets on this Forum or anywhere else is in violation with the EULA.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
Yes, I realised that shortly after posting and I appologise. It was not intentional, I just wanted to make it easier for you to understand the problem that I was trying to describe. We use a lot of public code in our aplication and indeed I forgot that your source code is license protected. Since I can no longer edit my posting, but please feel free to remove the code snippet from my posting.
On the subject of the memory leakage: by removing the event manually in my own code, before calling “jqxGrid(‘destroy’)”, I can see in the memory profiler that the dangling objects now get garbage collected.
Regards,
StephanHi Stephan,
No, problem. I just wanted to mention it. We will test it, too.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comIs this issue unattended? I am working with jqwidgets v3.5.0, jquery v1.11.1 in IE11 and Chrome 47 and having the same issue. We are evaluating possible jQuery plugins to design our company’s website. I programmatically unbinded the events and the memory keeps rising with each destroy –> reconstruct
Hi revilo7,
destroy removes all references to jqxGrid.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHello Peter;
I agree with you, I cannot find the widget in the DOM once the ‘destroy’ method is invoked. But I see a significant growth in memory every time I recreate the object.Hi revilo7,
We don’t know when browser releases its resources.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI strongly suggest that your team looks into this as for making the same exercise with other JS plugins our team can’t find an increment in memory usage. Great looks on the widgets and great ease of use but this is a big issue for the site my company wants to design.
Hi revilo7,
We have done that and “destroy” removes the widget from the DOM as well as all references to it. When the browser releases its memory is a matter of the browser’s garbage collector algorithm.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.