2009-2-22

flex magic bug3:几个垃圾回收的问题或bug

恶战了几天flex的垃圾回收,小有结果,包括:

在module中用方式引入css文件(编译期),则,扯淡。经测试目前找到两种解决方法,一种是把放到main app domain中去,因为module默认会继承main domain的css;第二种是把css编成swf后,在module中动态加载。估计module在编译期引入css时,会引用到main domain中的东西,造成无法GC。

2 mate框架中的Injector方法,类似映射或绑定,非常好用,但是很不幸,测试了n次后发现Injector会带来无法GC的问题,最近是没空再去翻mate源码了,用as自己的bindingUtil代替后问题解决。但mate maker说Injector不会产生GC问题。。。magic。

冷到家的一个bug。。。memory leak when using TextInput and TextArea when click the keyboard  只要用TextInput之类的组件,就无法垃圾回收,连这个都让我测试出来了- -b真不容易,可惜的是在上述链接中发现flash player team正在解决ing。。。于是到这一步垃圾回收战可以打住了,因为实在无法避免不用TextInput - -b,总得注册登录吧。。。爱谁谁,估计最后内存占用会超过100M……

以下是几个介绍垃圾回收的链接(决定以后按时阅读flex bug list。。。以上几个bug自己测出来太bt了):

http://roshantitus.blogspot.com/2008/11/flex-memory-management.html

http://www.cnblogs.com/janyou/archive/2008/11/25/1340753.html

http://www.nutrixinteractive.com/blog/?p=132

http://www.gskinner.com/blog/archives/2006/06/as3_resource_ma.html

http://blogs.adobe.com/aharui/2007/03/garbage_collection_and_memory.html

0 评论: