Adobe AIR 应用程序在空闲时间后响应缓慢 [英] Adobe AIR applications slow response after idle time

查看:20
本文介绍了Adobe AIR 应用程序在空闲时间后响应缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我花了数百美元用 Flex 4.0 开发了一个 Adob​​e AIR 应用程序,现在我认为我应该已经完成​​了,但是在让应用程序运行几个小时后,UI 响应性开始缺乏......

I spent hundreds of ours developing an Adobe AIR Application with Flex 4.0 and now I thought I should have finished, but after letting the application run for more than a few hours the UI-responsiveness begins to lack...

我做什么:我的应用程序通过将具有透明度的 backgroundImages 设置为 Window-modules 中的 BorderContainers 来使用自定义镶边.我打开了许多不同的弹出窗口,它们都基于 Window-Class(不是 TitleWindow!)并在 ActionScript 中动态创建和关闭.通过使用 Flex Profiler,我当然知道垃圾收集器会正确销毁所有已分配的资源,并且内存消耗不会随着应用程序正常运行时间而增加.此外,探查器向我展示,我的任何方法都没有占用大量 CPU 时间,因此这也应该没问题.

What I do: My application uses custom chromes by setting backgroundImages with transparency to BorderContainers within Window-modules. I open up many different popups, which all are based on the Window-Class (not TitleWindow!) and created and closed dynamically in ActionScript. By using the Flex Profiler I certainly know, that the garbage collector destroys all the allocated ressources correctly, and the memory consumption does not rise with application uptime. Further the profiler shows me, that none of my methods occupate extensive cpu-time, so this also should be ok.

真正有趣的是:如果我持续与应用程序交互(单击按钮,编写文本,...)什么也没有发生,一切都很好,但是如果我几分钟不与应用程序交互然后回来 - UI 响应能力真的很差!

What is really interesting: If I continously interact with the application (click buttons, write text,...) nothing happens and everything is fine, BUT if I do not interact with the application for several minutes and then come back - the UI-responsiveness is really poor!

非常糟糕的意思是,如果我在 TextInput-Control 中输入一些文本,我可以看到每一个写的字母至少有 1 秒的延迟!

Really poor means, that if I type some text into a TextInput-Control, I can watch every single letter being written with a delay of at least 1 second!

有没有人遇到过类似的情况,或者知道可能是什么问题的人?我的建议是,在某些活动之后,flash-player-runtime 会限制 AIR 应用程序的 CPU 使用率,并且在用户返回时不会完全恢复.

Has anyone experienced a similar situation, or someone who knows, what the problem could be? My suggestion is, that after some activity the flash-player-runtime limits the cpu-usage of the AIR application, and doesn't give back full power when the user returns.

我使用 Flex 4.0、Flex 4.1、AIR 1.5、AIR 2.0 和 Flash Player 9 以及在 Windows XP 和 Windows 7 上运行的 Flash Player 10 测试了该应用程序...

I tested the application with Flex 4.0, Flex 4.1, AIR 1.5, AIR 2.0 with Flash Player 9 and also Flash Player 10 running on Windows XP and Windows 7...

推荐答案

我终于找到了解决方案!

I have finally found the solution!

Flex 4 中引入的新 spark 组件向 WindowedApplication 类添加了一个名为backgroundFramerate"的属性.默认情况下,此属性设置为 1,这意味着当主 (!) 应用程序窗口处于非活动状态时,AIR 会自动调节帧速率.不幸的是,此帧速率用于整个应用程序,包括所有其他可能处于前台和活动状态的窗口实例!

The new spark-components introduced with Flex 4 added a property called "backgroundFramerate" to the WindowedApplication-class. By default, this property is set to 1, which means that AIR automatically throttles the framerate when the main (!) application-window get's inactive. Unfortunately this framerate is used for the whole application, including all other window-instances which could be in the foreground and active!

通过将 backgroundFramerate-property 设置为 -1 禁用自动帧率限制后,所有问题都消失了!

After disabling the automatic framerate-throttling by setting the backgroundFramerate-property to -1 all the problems were gone!

虽然,我知道,启动新的窗口派生对象来显示弹出窗口,但我相信这是 Flex 4 中的一个错误,仍未修复.

Altough, I know, that instiating new window-derived objects to show popup-windows, I believe that this is a bug in the Flex 4 which is still not fixed.

这篇关于Adobe AIR 应用程序在空闲时间后响应缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆