从Adobe论坛看来,更多的人对这个功能感兴趣,Adobe似乎还没有承诺执行它。如果任何人有相同的问题,并希望这种支持,请在Adobe论坛上投票: bugbase.adobe/index.cfm?event=bug&id=3011846
另外,处理内存密集的Adobe Air Desktop应用程序的任何提示都非常受欢迎。
解决方案ActionScript在内存管理方面存在潜在的设计缺陷。这取决于机器的行为有所不同。在Windows上,它大概在1.25GB,而即使是一个32位的操作系统可以处理更多。特别容易的是声音, ByteArray 和 FileStream 类,但在后台使用这些的人也受到影响。我知道在处理大量文件( FileStream )并操作它们时(的ByteArray )。在达到内存限制时引发的错误信息大多不会指向正确的错误源......在为 FileStream 类编写包装器和自定义调试器之后以处理它所有的奇怪(尝试长度为0字节的文件,最喜欢的错误来源)我拿出了4k行代码,但仍然无法控制所有的情况。
我在几乎任何内存密集的AIR应用程序中偶然发现了这些错误,最终决定退出ActionScript。至少从2009年开始,Adobe就必须知道底层的问题。还记得FP9打破了 unloadSound()方法,Adobe答应在FP10中修复它吗?那么,他们有点固定它,现在会少一些。但是这是关于它的。他们没有完全解决根本问题。因此,一个64位版本的AIR不会帮助你,除非Adobe修复底层架构中的错误。而他们在过去几年中处理ActionScript的方式,我不会打赌他们这样做。
这个函数最终让我意识到发生了什么事情。运行它,并在循环中查看并观察 res之后的 res 变量会发生什么.length == 18 。
public static function hexToString(hex:*,len:uint = 32):字符串 { if(hex == null || isNaN(hex)) { returnUNKNOWN TYPE; } var str:String =''; var strIn:String = hex.toString(16).substr(-len).toUpperCase(); var char:uint = 0x00; var charStr:String =''; var res:String =''; (strIn.length< len) { strIn ='0'+ strIn; 。 } res = strIn; (res.length> 1) { charStr ='0x'+ res.substr(0,2); 。 char = parseInt(charStr,16); res = res.substr(2); str + = String.fromCharCode(char); } return str;我将函数转换为PHP和JS来确认,PHP和JS都不显示错误的行为。
We are developing some memory intensive Adobe Air Desktop applications that sometimes peek above the 32 bit 1.3 Gb Limit in Windows and get purged by the OS. Unfortunately we can't find any options from Flex Builder to export to Windows 64 bit.
It seems from the Adobe forum that more people are interested in this feature and Adobe seems not committed yet to implemented it.
If anyone has the same issue and would like this supported please vote on the Adobe forum: bugbase.adobe/index.cfm?event=bug&id=3011846
Alternatively, any tips of dealing with memory intensive Adobe Air Desktop applications are very welcome.
解决方案ActionScript has an underlying design flaw in its memory management. This behaves differently depending on the machine. On Windows it roughly craps out at 1.25GB, while even a 32bit OS can handle more. Especially vulnerable are the Sound, ByteArray and FileStream classes, but others using these in the background are effected, too.
I learned that when dealing with lots of files (FileStream) and manipulating them (ByteArray). The error messages thrown when the memory limit is reached are however mostly not pointing to the correct source of the error... after writing a wrapper and a custom debugger for the FileStream class to handle all the oddities it has (try files with 0 bytes length, a favorite source of errors) I came down with 4k lines of code, but still couldn't get all cases under control.
I stumbled over these errors in almost any memory intensive AIR application I made and eventually decided to quit ActionScript. The underlying issue must be known to Adobe since at least 2009. Remember when FP9 broke the unloadSound() method and Adobe promised to fix it in FP10? Well, they somewhat fixed it, it would now happen less often. But that's about it. They didn't fix the underlying problem entirely.
So, a 64bit version of AIR won't help you unless Adobe fixes the bugs in the underlying architecture. And the way they handled ActionScript in the last years, I wouldn't bet on them doing that.
This is the function that finally made me realize what's going on. Run it and step through the while loop and watch what happens to the res variable after res.length == 18.
public static function hexToString(hex:*, len:uint = 32):String { if (hex == null || isNaN(hex)) { return "UNKNOWN TYPE"; } var str:String = ''; var strIn:String = hex.toString(16).substr(-len).toUpperCase(); var char:uint = 0x00; var charStr:String = ''; var res:String = ''; while (strIn.length < len) { strIn = '0'+strIn; } res = strIn; while (res.length > 1) { charStr = '0x'+res.substr(0, 2); char = parseInt(charStr, 16); res = res.substr(2); str += String.fromCharCode(char); } return str; }I converted the function to PHP and JS to confirm and neither PHP nor JS showed erroneous behavior.
更多推荐
适用于Windows 64位的Adobe Air?
发布评论