Hybrid View

    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,978
    Vote Rating
    132
    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,978
    Vote Rating
    132
    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,978
    Vote Rating
    132
    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

Thread Participants: 1

Tags for this Thread