开发者

away3d remove from memory

开发者 https://www.devze.com 2022-12-21 11:19 出处:网络
I am building a website which loads some collada objects for each area. But I couldn\'t manage to clean the memory. It seems impossible to kill the objects.

I am building a website which loads some collada objects for each area.

But I couldn't manage to clean the memory. It seems impossible to kill the objects.

I've found some samples implementing destroy() methods for away3d internal classes, but they're not working as well.

I really don't know if开发者_如何学运维 this is a problem with player's garbage collector or with away3d itself.

Any ideas?


I'm pretty sure the problem is with Away3D and not the garbage collector. I've had a similar issue and after a lot of searching I just had to deal with the memory leak and try to stop it from getting out of hand by recycling the objects/pooling.

You can see that memory leaks are actively discussed on the forums but there hasn't been much in the way of easy fixes: http://groups.google.com/group/away3d-dev/browse_thread/thread/3d31808f4d50f0d2/0ef840a2395f3783?lnk=gst&q=memory#0ef840a2395f3783


Grant Skinner figured out an unsupported way of Forcing Garbage Collection, maybe try that out and see if memory usage decreases? If not, it's at least not the flash player.

try {
   new LocalConnection().connect('foo');
   new LocalConnection().connect('foo');
} catch (e:*) {}
// the GC will perform a full mark/sweep
// on the second call of new LocalConnection().connect().

Best, Lance

0

精彩评论

暂无评论...
验证码 换一张
取 消