A Flash Developer Resource Site

Results 1 to 9 of 9

Thread: [Resolved] Flash5 memory problem with xml..

  1. #1
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    Could anyone help me with the following problem?

    I make new xml object and load file...
    myXML = new XML();
    myXML.onLoad = myParseXML;
    myXML.load("my.xml");

    and when I don't need that XML object i just delete it with command
    delete myXML;

    I need to do this in loop for example once per one minute.....

    My problem is....
    delete myXML; don't remove really that XML object from memory or don't free the memory correctly.

    When i check do myXML object have anything inside after removing it, everything seems to be just fine (it is empty),
    but when i put my swf to html page and check how much IE uses memory it seems to me that it's using more and more
    memory...and after night it can use 100mt memory. Removing other objects or arrays works proberly and it seems to me that Flash player that comes with Flash can handle memory correctly too.

  2. #2
    Senior Member
    Join Date
    Feb 2001
    Location
    Provo, Utah
    Posts
    1,112

    Uhh...

    Sorry - I've never run into the problem you're having... Does it involve your Cache - or just system RAM?

  3. #3
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    I'm not sure about cache....it seems to me that it involves only system RAM. I got following explanation from Macromedia Tech Support but i am not sure is it that kind of problem because it happens only with XML objects. But maybe loading those xml files in different *.swf and then unloading that *.swf helps....i have to test that....

    >The memory monitor doesn't necessarily monitor how much >memory is currently
    >in use by Flash , but rather how much has been >*requested.* Flash reserves
    >this memory until another process requests it, but >relinquishes it upon
    >request. Using the memory monitor may not be giving you >an accurate
    >picture.

    >Explicitly deleting an object will cause Flash to release >that chunk of
    >memory internally for other uses. In the case of >automatic garbage
    >collection (such as when a function with local variables >exits) the memory
    >is not immediately released - the instance count is >decremented and the
    >garbage collection actually deletes the object when there >are enough free
    >cycles to do so. This can appear as a "delayed reaction" >as far as memory
    >being freed up.

    >Macromedia Tech Support

  4. #4
    Senior Member
    Join Date
    Oct 2000
    Location
    2006: Thika, Kenya
    Posts
    955
    Not sure if this is your problem, but it sounds a little like the problem I had with loading text files into flash.

    Basically I had a text file that was being updated by an Admin system. The problem was, in IE the text file was being cached, so the same one would appear all the time. The way around it was that on an Apache server, you can write some code in the .htaccess file, either in your root directory, or just the folder with the updated content, that will not allow the file to be cached at all. The code to write in the file is:

    ExpiresActive On
    ExpiresByType text/plain A1

    I'm no expert on this, so don't ask me anything else on it, just search the web as I did.

    And as for other servers, and NT platforms, I would presume there's an equivalent somewhere.

    Cheers
    Dave

  5. #5
    Senior Member tupps's Avatar
    Join Date
    Jan 2001
    Location
    Melbourne
    Posts
    2,035
    I believe that Flash's Garbage Collection is not necessarily called immediately especially if there are other things going on. If you have lots of Ram in your machine and you are not idle (which is more likely in a web page, flash gets less processor time) garbage collection will not occur.

    Also IE will keep things cached and again will use up a lot of ram if it is available.

    Cya

    Tupps

  6. #6
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    Well no real problem is that flash keeped running about 97 minutes normally and after that stopped loading those xml files... quite weirdo....thanks anyway...i just have to check if that problem is in my code or somewhere else.. i keep on testing...

    - Jeicei


  7. #7
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    well no real problem...

    should be:

    well...real problem...

    sorry

  8. #8
    Junior Member
    Join Date
    Oct 2001
    Posts
    5
    well no real problem...

    should be:

    well...real problem...

    sorry

  9. #9
    Senior Member
    Join Date
    Mar 2001
    Location
    Location : Location
    Posts
    131
    I've just seen your thread so sorry if you have moved on but I had the same problem.

    I loaded my xml files , dumped them into a series of arrays and then, rather than delete them, re-initialised them by re-declaring them [myXML = newXML()]. Although they showed up as empty on show variables, when the site ran on IE6 it ran at about quarter speed, and this was after a good 60 second pause. It ran normally on N6 and Opera 5.1 but almost crashed a mac:

    see my thread -
    [xml driven data-site pleeeeeeeese check it out and comment]
    http://board.flashkit.com/board/show...hreadid=223366

    I've just removed the code that re-initialised the xml files and all is well:

    It is not your imagination: there is an issue here.


Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center