26 Oct 2012 12:10 PM #1
[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.
Ext version tested:
- Ext 4.1.1
- 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.
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 #2
- Join Date
- Mar 2007
- Gainesville, FL
- Vote Rating
I'm not seeing this. In beforeDestroy it does Ext.destroyMembers which will destroy the toolbar and it's items.Mitchell Simoens @LikelyMitch
Sencha Inc, Senior Software Engineer
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
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 email@example.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is 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:
94,908 1rst refresh
310,724 10th refresh
551,820 20th refresh
1,269,416 50th refresh
Memory usage without combo:
70,768 1rst refresh
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
Ext.EventManager.on(window, 'unload', me.beforeDestroy, me);
31 Oct 2012 6:49 PM #5
- Join Date
- Apr 2007
- Sydney, Australia
- Vote Rating
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
Twitter - @evantrimboli
Don't be afraid of the source code!