Author Topic: Garbage collector  (Read 1205 times)

med wed   «   on: October 20, 2010, 10:08:02 AM »
Hi, I've been working on flare3d for a while and I find it pretty amazing, thanks folks for this wonderfull software.
My problem is this: After making a set of interactive 3d animations and put them in a flash gallery, I found out that no matter how I do there are always elements stuck on the memory and don't get flushed away by the garbage collector, I nulled the references , removed the children and the event listener , and tried the dispose methode... nothing can seem to kill the 3d elements of the animations. recycling also doesn't work ( I can't to seem to find a good way to recycle a 3d scene within flare 3d to be honest ) :(.
Someone can help me please with that ? or give me some pieces of advice, I would be very gratefull.

med wed   «   Reply #1 on: October 20, 2010, 03:04:59 PM »
Is there a way I can remove a parent sprite without losing the scene ?
I mean what I do when recycling my objects is I put them in an array , I remove them from the display list by removeChild method  and then I add them back again. but whenever I do that for a parent of the flare main class I can't get the scene back right away. I have to rather removing the parents from the display list just set their visible mode to false witch is not practical. is there a way to remove the parents but keep the scene in the child class there in pause state or another inactive state ???
thanks in advance.


med wed   «   Reply #3 on: October 21, 2010, 12:23:11 PM »
Thank you Nehmad, Ariel for this answer. I ll try removing objects before removing parent movie clip and give feed back :)

med wed   «   Reply #4 on: October 22, 2010, 12:35:09 AM »
Hi , I tried to free the memory using the beta version source, but it didn't work for me. the memory usage keeps growing each time I load a flare3d file and dispose the scene. here is the code I'm using,

package classes.animations
{
    import flare.basic.Viewer3D;
    import flare.basic.Scene3D;
    import flare.core.Pivot3D;
    import flare.utils.*;
    import flash.display.Sprite;
    import flash.events.Event;

    public class Main extends Sprite
    {
        private var scene:Scene3D;
        private var genLink:String;
       
        public function Main(_genLink:String)
        {
            genLink = _genLink;
            xml3DLoaded();
        }
        // the recycling function
        public function mainRecycle(_genLink:String):void
        {
            genLink = _genLink;
            xml3DLoaded();
        }
        function xml3DLoaded():void
        {
            scene = new Viewer3D(this);
            scene.addChildFromFile(genLink);
        }
        // the destroyer function
        public function eventsKiller():void
        {
            scene.dispose();
        }
    }
}

 if u run it on a flare 3d files of 8000 polygons or so u ll notice that the memory usage keeps growing. Can please somebody tell me what I'm doing wrong or how I can fix it to get the garbage collector to do the job ??
Thanks in advance.

Ariel Nehmad   «   Reply #5 on: October 22, 2010, 05:58:34 PM »
Hi med, we'll take a look at this as soon as possible.

med wed   «   Reply #6 on: October 22, 2010, 06:45:57 PM »
Thank you :)

Joseba Alonso   «   Reply #7 on: November 29, 2010, 10:22:39 AM »
Hi,

Any advance on this? I have the same problem. I use the engine in several parts of my application and i cant recycle the instance because it disposes itself when i reparent it to another sprite. Creating new instances seems to be memory leaking..

I understand that you dispose the scene when the child is removed from stage to protect some people for not calling dispose() explicitly but you should leave an option for advanced users who wants to keep it in memory.

Anyway, is there any beta version or something that solves this? Thanks!

med wed   «   Reply #8 on: November 29, 2010, 11:38:03 AM »
Well, I'm still waiting for that too. Right now what I'm doing is setting the 3d scenes to invisible and I visible them each time i need to display them , wich is not practical at all but it's the only solution I came up with. :(

Joseba Alonso   «   Reply #9 on: November 29, 2010, 03:14:17 PM »
yes, im tempted to do the same. Lets see if Flare3d team tells us something before do it... Just a way to avoiding the removeChild disposal will do the trick

masterkitano mk   «   Reply #10 on: November 30, 2010, 06:29:45 AM »
does anyone knows whats the max ploys that can be used in a flare3d scene? without loosing performance

med wed   «   Reply #11 on: November 30, 2010, 12:51:30 PM »
5000 polygons work for me, but I never go beyond 8000 , it starts to get less fluid. it's best if u can stay under 5000 polygons.

Bruno Perry   «   Reply #12 on: December 14, 2010, 11:12:56 PM »
Hi there!

First off, thanks a lot for this great engine, it rocks!

But I'm also having the same issue here :(

Any news about this?

Cheers!

Ariel Nehmad   «   Reply #13 on: December 14, 2010, 11:40:56 PM »
i know we have a big issue here, so i promise, we´ll take time next week to solve the garbage collector.

we have been working on GC for Flare3D 2.0, so i guess it will take a bit to get version 1.0 working fine too.

Ariel Nehmad   «   Reply #14 on: December 14, 2010, 11:45:08 PM »
if anyone can provide us some examples to help to solve this, we´ll be very grateful ;)