Hi Folks,

I've read up on grant skinners' articles about the garbage collector and how
the new memory
management gets done in as3. I've build some test cases to see how the new
virtual machine
handles stuff, and came upon some weirdness.

I have two classes, GCTester and GCTarget.

GCTester instantiates GCTarget, throws its reference away immediatly and
forces the gc to kick in (gskinner's localconnection trick):

           var b:GCTarget=new GCTarget(0,0);
           b=null;
           try {
                  new LocalConnection().connect('foo');
                  new LocalConnection().connect('foo');
               } catch (e:*) {trace("err");}

GCTarget only listens to an enterframe event and traces something so I know
wether it's still alive or not.

Now the weird situation;

When GCTarget has NO attributes to be passed to its constructor, everything
works fine. It instantiates and
gets thrown away immediatly, the gc kicks in, and not even a single trace
shows up, (if I don't use the localconnection
trick, it does trace, for obvious reasons).

When the GCTarget gets two variables (see above example, (0,0)) passed to
its constructor. And sets its .x and .y to these values, the trace
goes on infinitely, even when I force the gc mutltiple times.. So it never
gets garbage collected, or so it seems :(.

What's going on?

thx,

Meinte
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to