Wait! Looks like we don't have enough information to add this to bug database. Please follow this template bug format.
  1. #1
    Sencha User th3nu11's Avatar
    Join Date
    Apr 2013
    Posts
    28
    Vote Rating
    0
    th3nu11 is on a distinguished road

      0  

    Default Template - ItemdId - Memory leak

    Template - ItemdId - Memory leak


    Sencha Touch version tested:
    • 2.3.1
    Platform tested against:
    • Browser and devices
    Description:

    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.

    Steps:
    • 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:
    Memory will be realeased by garbage collectors




    The result that occurs instead:
    Memory will be not released!
    Ext.dom.Element.cache grow up!

  2. #2
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,875
    Vote Rating
    128
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    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.
    https://fiddle.sencha.com/#home
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  3. #3
    Sencha User th3nu11's Avatar
    Join Date
    Apr 2013
    Posts
    28
    Vote Rating
    0
    th3nu11 is on a distinguished road

      0  

    Default


    I investigated better this behavior:
    1. I run a query on html element (in my case on element of an item template)
    2. senchaTouch creates an "Ext.dom.Element" for the query result element
    3. this element will be cached in "Ext.domElement.cache"
    4. nobody never will remove it.
    I must remove it from cache
    delete Ext.dom.Element.cache[element.id];

    am I doing something wrong?

  4. #4
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,875
    Vote Rating
    128
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    You should not have to. Can you provide a fiddle that reproduces this behavior.
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  5. #5
    Sencha User th3nu11's Avatar
    Join Date
    Apr 2013
    Posts
    28
    Vote Rating
    0
    th3nu11 is on a distinguished road

      0  

    Default


    tap button many times and watch the browser console.
    Attached Files

  6. #6
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,875
    Vote Rating
    128
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    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?
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

  7. #7
    Sencha User th3nu11's Avatar
    Join Date
    Apr 2013
    Posts
    28
    Vote Rating
    0
    th3nu11 is on a distinguished road

      0  

    Default


    I think the problem is caused by the query that creates an Ext.Element independently from the field used for the query.


    However I use itemId like Id: I use this field for have an identifier for every Component that I need to search. is it wrong? is there a better way?

    Regards!

  8. #8
    Sencha - Support Team
    Join Date
    Oct 2011
    Posts
    3,875
    Vote Rating
    128
    fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all fmoseley is a name known to all

      0  

    Default


    Well id's are usually intended to be unique within a html document. The way you have it set up each list item will have the same id. I don't think it is necessary as you can use component query to retrieve your list based on its itemId (itemId: 'myList') and the getInnerItems() method to get access to the list items.
    Check out the console results on the following fiddle: https://fiddle.sencha.com/#fiddle/4di
    Get more personalized support via a support subscription.

    Want to learn Sencha Touch 2? Check out
    Sencha training
    Sencha Touch in Action

    Need more help with your app? Hire Sencha Services services@sencha.com

    When posting code, please use BBCode's CODE tags.

    Need to include a test case use:
    The official Sencha Fiddle

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi