-
26 Oct 2012 12:10 PM #1
[4.1.1] IE7 memory leak after adding combobox to htmleditor toolbar
[4.1.1] IE7 memory leak after adding combobox to htmleditor toolbar
This is my second attempt at reporting this. The first post was deleted with no explanation.
MODS: if there is a problem with the format or content please let me know and I will correct it.
REQUIRED INFORMATION
Ext version tested:- Ext 4.1.1
- IE7
- IE8
- IE9
- Adding a combo box to the toolbar of Ext.form.HtmlEditor causes a large memory leak in IE7 on page unload. This memory is not garbage collected and never goes away. It will continue to rise about 30MB each time the component is unloaded. This does not appear to be an issue in IE8 or IE9. I have not tested it on IE6.
- See test case below.
- Memory should return to pre page load level after navigating away from page.
- Memory increases about 30MB each time page is unloaded.
Code:<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <link rel="stylesheet" type="text/css" href="http://extjs.cachefly.net/ext-4.1.1-gpl/resources/css/ext-all.css"> <script src="http://extjs.cachefly.net/ext-4.1.1-gpl/ext-all-debug.js"></script> <script type="text/javascript"> Ext.onReady(function() { Ext.define('CustomEditor', { extend : 'Ext.form.HtmlEditor', initComponent : function() { this.callParent(arguments); var toolbar = this.getToolbar(); toolbar.add('->', 'Label:' // Comment out the combo, and no memory leak! ,{ xtype : 'combo', width : 100 } ); } }); Ext.create('CustomEditor', { width : 700, height : 250, renderTo : 'editDiv' }); }); </script> </head> <body> <div id="editDiv"> </div> </body> </html>
HELPFUL INFORMATION
Debugging already done:- Comment out the combo box in the code above and there won't be a leak.
- not provided
- only default ext-all.css
- WinXP Pro (IE7/8)
- Win7 (IE9)
-
27 Oct 2012 12:34 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 33,599
- Vote Rating
- 434
I'm not seeing this. In beforeDestroy it does Ext.destroyMembers which will destroy the toolbar and it's items.
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
30 Oct 2012 8:39 AM #3
What version of IE7 did you test this with?
I can reproduce it in the following environments:
Lenovo T61 2.2GHz/2GB RAM
XP Pro SP3
IE7 version 7.0.5730.13
Memory usage with combo:
19,024 about:blank
70,692 load
94,908 1rst refresh
118,880
143,536
167,380
191,204
215,484
239,372
263,204
286,944
310,724 10th refresh
...
551,820 20th refresh
...
1,269,416 50th refresh
Memory usage without combo:
19,024 about:blank
70,008 load
70,768 1rst refresh
71,140
71,224
71,312
71,556
71,776
72,144
71,892
72,068
71,916 10th refresh
I also got similar results using:
Virtual Machine 2.39GHz/1GB RAM
Windows Server 2003 Enterprise Edition SP2
IE7 version 7.0.5730.11
When I set break points in Firefox/Firebug, it seems that the HtmlEditor beforeDestroy function is never called. I see it getting set in initEditor, but it doesn't stop anywhere in beforeDestroy. If that's the case then the component is never getting cleaned up.
-
31 Oct 2012 8:59 AM #4
Some more debugging: I overrode the initEditor function of HtmlEditor and replaced
withCode:Ext.EventManager.on(window, 'unload', me.beforeDestroy, me);
and now beforeDestroy is running in both Firefox and IE7. However the memory leak is still there in IE7. Stepping through the code in Firefox it does appear that all the items on the toolbar are getting removed/destroyed, as well as the toolbar from the editor, so I'm still at a loss as to what's going on in IE7.Code:Ext.EventManager.onWindowUnload(me.beforeDestroy, me);
-
31 Oct 2012 6:49 PM #5
I agree it should use the onWindowUnload method. However, IE6/7 are notoriously bad for iframe memory management. For example, you can load up a page where you include an iframe pointing to google and you'll see the memory grow on each refresh. I'm not really sure if there's a whole lot we can do to resolve the issue.
Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
You found a bug! We've classified it as
EXTJSIV-7655
.
We encourage you to continue the discussion and to find an acceptable workaround while we work on a permanent fix.


Reply With Quote