【发布时间】:2011-04-16 10:51:49
【问题描述】:
例如,在本地网络中,当 Adobe Air 正在从本地服务器 (\\Server\storage\) 读取文件并且网络将处于关闭状态一秒钟时,Air 会占用大量内存并增加到 1GB(而正常内存使用量为 100 kb 或更少)。
仅从不稳定的网络读取带有File('file path on local server'); 的文件可能会导致此错误。
有人在项目中看到过吗?
private function init() : void
{
file = new File("\\Server\dragracing\results.txt");
fileStream = new FileStream();
fileStream.addEventListener( Event.COMPLETE, fileComplete );
fileStream.openAsync( file, FileMode.READ );
}
private function fileComplete( event : Event ):void
{
fileContents = fileStream.readMultiByte( fileStream.bytesAvailable, ISO_CS );
.....
}
]]>
【问题讨论】:
-
您介意展示您的代码吗?导致严重内存泄漏的可能是您的代码而不是 Air。
标签: apache-flex air adobe