Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Dec 2009

    Memory Leak during XML.Load()


    I've done the following using AS2:

    1) in the first frame of the application declare/create and load a large XML file
    2) move to another label frame
    3) reload the same xml file again

    I've noticed on the Device Central that the available memory starts to decrease everytime I reload the very same xml file. Apparently there is no garbage collection when XML Object reloads.

    Occording to S60 documentation, S60 will do garbage collection once every 60 seconds. So I set a timer creating and event every 90 seconds to create an XML object and load the large XML file. After having loaded the data file, delete the Object instance. This still generates memory leak and application soon fails due to insuffient memory. S60 for some reason does not clean up the heap.

    Does anyone know about this behaviour?

    Thanks for any help.



  2. #2
    Nokia Developer Champion
    Join Date
    Jul 2008

    Smile Re: Memory Leak during XML.Load()

    Firstly, it is not recommended to load large xml files. It is good to break large xml files in small xml files and then make several data-loading calls for each file. Read here :
    Loading Large XML files
    Secondly, u mentioned right that the Garbage collection gets clear after every 60 seconds or when the memory suddenly grow upto 20%. So, r u achieving this task like this :
    1- Load XML
    2- After loading, set the local variables/objects to null and deleting the global variables/objects.
    3- Use setInterval to wait for 60 seconds.
    4- Load the next XML file.
    I am sure that u know that :
    You can't use the delete statement to free memory that a local function variable uses
    So, set local function variable/objects to NULL instead of deleting them.For more details , please read this :
    Memory Management in Flash Lite
    Hope after reading this & implementing the correct logic , u r able to solve this issue.

    Best Regards,

Similar Threads

  1. memory jump while running game
    By TacB0sS in forum Mobile Java Games
    Replies: 21
    Last Post: 2009-06-20, 11:56
  2. Replies: 1
    Last Post: 2009-05-21, 11:39
  3. memory leak on emulator = memory leak on device
    By manmli in forum Mobile Java General
    Replies: 2
    Last Post: 2006-08-05, 19:54
  4. Replies: 0
    Last Post: 2006-02-20, 11:51
  5. can not successfully link any sample using .NET
    By lobotomat in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2002-08-20, 00:29

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts