6 Mar 2014 7:25 AM #1
Template - ItemdId - Memory leakSencha Touch version tested:
- Browser and devices
There is a memory leak if you use itemId in template elements the memory . Ext.dom.Element.cache increase every time you show a template.
- Create a list that use template (tpl:String/String/Ext.Template/Ext.XTemplate) for items
- Create a store with many elements
- Write template using some html elements (an heavy elements is better)
- Add to template elements an attribute itemId
- get this element by item.element.down
- call "store.load()" continuously
- The result that was expected:
The result that occurs instead:
Memory will be not released!
Ext.dom.Element.cache grow up!
6 Mar 2014 11:40 AM #2
The JS garbage collector releases memory at random times how long of a period are you testing over?
I would also suggest using the Chrome developer tools profile panel to check for leaks.
FYI when you take a heap snapshot in chrome dev tools it does initiate the garbage collector.
It would help expedite this issue if you put together a fiddle and verify that it reproduces this behavior.
7 Mar 2014 1:55 AM #3
I investigated better this behavior:
- I run a query on html element (in my case on element of an item template)
- senchaTouch creates an "Ext.dom.Element" for the query result element
- this element will be cached in "Ext.domElement.cache"
- nobody never will remove it.
am I doing something wrong?
7 Mar 2014 12:43 PM #4
You should not have to. Can you provide a fiddle that reproduces this behavior.
10 Mar 2014 2:54 AM #5
tap button many times and watch the browser console.
20 Mar 2014 9:07 AM #6
Thanks for the test case. I have verified that it reproduces the issue you are reporting. I am unfamiliar with the itemId attribute. For what purpose are you using it?