jQuery UI Widgets › Forums › Editors › Button, RepeatButton, ToggleButton, LinkButton › jqxDropDownButton
Tagged: jqxDropDownButton, Memory Leak, performance
This topic contains 4 replies, has 2 voices, and was last updated by admin 8 years, 6 months ago.
-
AuthorjqxDropDownButton Posts
-
Hello,
I am working on a moderately sized SPA which makes use of jQWidgets. We currently use a jqxDropDownButton, with jqxListBox for it’s content, however during testing a significant slow down is noticed after a period of use.
I’ve investigated the jqxDropDown button in isolation, and have come to the conclusion that this is one of the areas responsible for both the memory leak and hit to performance that we are seeing. See my test page below:
<!DOCTYPE HTML> <html> <head> <link rel="stylesheet" type="text/css" href="styles/jqx.base.css"/> <link rel="stylesheet" type="text/css" href="styles/jqx.shinyblack.css"/> <script type="text/javascript" src="jquery-2.1.1.js"></script> <script type="text/javascript" src="jqxcore.js"></script> <script type="text/javascript" src="jqx-all.js"></script> <script type='text/javascript'> $(window).load(function(){ $('#button1').on('click', function button1Click() { $('#jqxWidget').append("<div id='dropDownButton'></div>"); $("#dropDownButton").jqxDropDownButton({ width: 150, height: 19, theme: 'shinyblack' }); }); $('#button2').on('click', function button2Click() { $("#dropDownButton").jqxDropDownButton('destroy'); $("#dropDownButton").remove(); }); }); </script> </head> <body> <h1>jqxDropDownButton Test</h2> <div> <div> <button id='button1'>Add</button> <button id='button2'>Remove</button> </div> <div id='jqxWidget'></div> </div> </body> </html>
Having profiled this using Chrome, I can see that every time I Add and then Remove the jqxDropDownButton, the number of div elements and objects in memory increases, but never decreases.
Can someone take a look at this and confirm the issue? Also if there is a workaround or I should be doing this differently, please let me know.
I should add that I tried the same test with jqxButton, and saw no memory leak, and it was correctly being cleaned up.
Thanks in advance.
To make things easier, I’ve also created a jsFiddle here https://jsfiddle.net/ku3qof2x/
To see the leak, click the add and remove buttons, capturing the heap snapshot every time.
Thanks.Hi DuaneC,
We do not see the number of DIV tags to increase after adding/removing the DropDownButton. However, in case we reproduce the reported behavior, we will create a work item for future jQWidgets update. Thank you for feedback!
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comOk thanks Peter.
Is there anything I can do to confirm with you what I am seeing? Should I e-mail images if that would help?Can you could advise if there might be a short term solution for this? Due to it’s impact I may have to consider removing this widget from our app, but I would prefer not to do this.
I have since learned that we have a platinum support package included with our license, so if you think I should follow up there instead, please let me know.
Thanks in advance.
Kind regards.
Hi DuaneC,
It’s not necessary to do anything. We will test it, if we confirm it we will add a work item for future release. For now, there is nothing more I can share.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.com -
AuthorPosts
You must be logged in to reply to this topic.