Forum ActionScript 3.0 Multiplayer.joinRoom GC issues.

Problems and discussions relating to ActionScript 3.0 here.

Multiplayer.joinRoom GC issues.

Postby zeroZshadow » February 17th, 2015, 2:57 pm

Hello everyone,
I'm having some wierd issues while trying to fix my memory leaks. Im using a Dictionary with weak keys to keep track of all objects that are in my game, combiner with a force garbage collection and printen whatever isnt null afterwards.

I've stumbled on the following issues, objects that have their functions passed to Multiplayer.joinRoom as callbacks, are not GC'd
In my case i have a Class JoinRoomAlgo, which will pass 2 of its own functions when trying to connect. When later i undo the connection, i do connection.Disconnect() and remove all References to both the JoinRoomAlgo instance, and the connection object itself.
However both persist in memory.

I've trying looking at any and every spot that could somehow still have a reference to these objects, but there simply isnt any. Thus i've come to the conclusion that Player.IO might be doing something wrong.

To proof that I do not have a lingering reference to JoinRoomAlgo, i even make a temporary object BEFORE using joinRoom. This object has the 2 callbacks and a reference to the JoinRoomAlgo. the callbacks simple pass on the parameters to the ACTUAL callbacks on JoinRoomAlgo, and then set the reference to the object to null. The temporary object will stay in memory, while the JoinRoomAlgo instance will now propperly be collected.

Does anyone have a propper solution for this?
zeroZshadow
 
Posts: 2
Joined: February 17th, 2015, 2:43 pm

Re: Multiplayer.joinRoom GC issues.

Postby Henrik » February 17th, 2015, 5:59 pm

Interesting, we'll take a look as well.
Henrik
.IO
 
Posts: 1880
Joined: January 4th, 2010, 1:53 pm

Re: Multiplayer.joinRoom GC issues.

Postby zeroZshadow » February 17th, 2015, 6:33 pm

As a side note, I've also noticed that the Connection object stays in memory. This wasn't as well triple checked as the main issue, but might be connected?
I'll also be in the #player.io channel on freenode all day tomorrow in case any extra information is required (should be faster then the forum) Starting at 10 am GMT+1
zeroZshadow
 
Posts: 2
Joined: February 17th, 2015, 2:43 pm


Return to ActionScript 3.0



cron