memory - actionscript 3.0 how to clear RAM -
i'm using actionscript p2p application transfer files between peers. received files bytearrays stored in 1 array one:
recvfiles[peerid][fileid].data:bytearray = filereference.data
now i'm stuck in such situation - if decided transfer files size greater 1gb. means receiver memory gonna clogged.
how can delete saved file bytearray after user save on pc?
i thought this:
recvfiles[peerid][fileid] = null;
but i'm newbie in actionscript , don't how interracts memory...
so question best way clear memory?
thanks help!
yes, should it. can try force garbage collection immediately, although not officially supported. can making localconnection. there more here on grant skinner's blog:
http://gskinner.com/blog/archives/2006/08/as3_resource_ma_2.html
try { new localconnection().connect('foo'); new localconnection().connect('foo'); } catch (e:*) {} // gc perform full mark/sweep on second call.
if testing using debug version of flash player 10 or greater, can force it:
http://help.adobe.com/en_us/flashplatform/reference/actionscript/3/flash/system/system.html#gc()
system.gc();
...but keep in mind 2nd option debug version. users won't have installed.
Comments
Post a Comment