-
9 Dec 2009 5:51 AM #1
[OPEN][3.x] Floating Menu memory Leak - Ext.Shadows are never destroyed
[OPEN][3.x] Floating Menu memory Leak - Ext.Shadows are never destroyed
Hi,
when clicking on the column menu, this create a menu and lots of DOM elements.
When hide this menu, and when i destroy the gridPanel, these DOM elements are still here.
Any idea ? I would prefer ask, because of my latest post was a memory leak bugfixed in the 3.1 version
So, if it's already bugfixed, i would prefer to know now.
Thanks for help
P.S : any idea for the 3.1 release date ?
-
9 Dec 2009 7:01 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
The menus themselves get destroyed, but the shadow elements are left behind.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
9 Dec 2009 7:05 AM #3
so ?
no fix available ? neither in 3.1 ?
-
9 Dec 2009 7:13 AM #4Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
so? These shadow elements are reused throughougt the application where menus are reshown.
This is not a bug. You need to be clear on terms like "Memory leak". In my opinion, this is not a flaw and there is no memory leak present.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
9 Dec 2009 7:13 AM #5Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
Btw, I tested this in the pre-final 3.1 release.

Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
9 Dec 2009 8:46 AM #6
re-used ?
don't agree with u.
Be sure i do some tests (and some code reviews) before posting here
My test case is the following :
Show a grid, open the column menu, then destroy the grid : 23 DOM elements in sIEve
repeat twice : 46 elements in sIEve
repeat more : 69 elements ! and telling me re-used ? when ?
not releasing elements in my menu :
- 1 SPAN (x-menu-item-text) + 1 IMG (x-menu-item-icon) by Menu Item,
- some DIV and BUTTONS (pagingtoolbar) not released due to sus-mentioned memory leak
-
9 Dec 2009 8:59 AM #7Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
I can't validate your test case because you're not providing enough information.
You can't just go around posting threads in the bug forum like http://www.extjs.com/forum/showthrea...003#post417003 and expect to get a valid response.
That said, please read the following thread: http://www.extjs.com/forum/showthread.php?t=71015 and post something that we can easily reproduce.
I tested in Firebug while viewing the DOM manipulation piece in the array grid example.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
9 Dec 2009 9:03 AM #8Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- Frederick MD, NYC, DC
- Posts
- 16,169
- Vote Rating
- 28
The left over shadow elements are left for reuse for future menus to be displayed.
I do think that they should be destroyed when no more instances of Ext.menu.Menu exist.
Jay Garcia @ModusJesus || Modus Create co-founder
Ext JS in Action author
Sencha Touch in Action author
Get in touch for Ext JS & Sencha Touch Touch Training
We are also working on Video-based Sencha Touch training: Check it out here.
-
9 Dec 2009 9:05 AM #9
Okay guy...
So, i'll wait for the 3.1 release, expecting this problem will disappear, otherwise i'll post a complete testcase.
Thanks for your support
Pyja
-
9 Dec 2009 9:14 AM #10
Hmmm.. there does seem to be a bug actually.
floating Ext.menu.Menus (as is the case with gridpanel column menus) are actually just Ext.Layers with supporting Ext.Shadow instances.
when a floating menu (i.e. an Ext.Layer) is destroyed, the corresponding Ext.Shadow is hidden but never destroyed. Here's the code for Ext.Layer#destroy()
note the portion in red.Code:// private destroy : function(){ this.hideShim(); if(this.shadow){ this.shadow.hide(); } this.removeAllListeners(); Ext.removeNode(this.dom); delete this.dom; },
i do see code for an Ext.Shadow.Pool, but it seems that the only times Shadows are retrieved / returned to the Pool are when they're hidden / shown. In the case of Ext.Layers, the Shadows are always created anew for every instance.
The code for Ext.Shadow / Ext.Shadow.Pool definitely needs to be looked at.
I'll mark this thread [UNKNOWN] for closer scrutiny.
Also renamed it for better visibility.Last edited by mystix; 9 Dec 2009 at 10:08 AM. Reason: An Ext.Layer only creates a new Shadow if a shadow config has been specified. Pool size, however, has no upper limit.
Sencha Docs / Ext 3.x - ( Docs | Examples )
Learning Center / Saki's Examples (for 2.x) / HOWTO - ( Report Bugs | Post Proper Code )
Thank you for reporting this bug. We will make it our priority to review this report.


Reply With Quote