I've got the exact same problem.
We have an AIR application taking care of uploading files to a server.
When the application loses the focus (another window selected in the OS), the performance is greatly reduced (almost of an order of 10).
It is a real drawback in our case, as the goal of the application is indeed for the user to be able to continue working while the upload is taking care of, so the app is meant to be put in the background.
If it is throttled by AIR, I would be very interesting to access and modify this setting from within the app.
Thanks for the help!
I am suffering from this exact problem. I need my app, under very specific circumstances, to do a very simple tween while in the background... unfortunately with the amount of "throttling" taking place, it can't be done.
I am only replying to this to show there is more demand for an answer and so I can be emailed when an answer is supplied.
Yes...to this day, I still haven't found a solution. It doesn't seem like the release of AIR 2 did anything to solve it.
1 person found this helpful
I read an article last week that might help with managing your background cpu usage. Check out Ten tips for building better Adobe AIR applications, in particular the section for Reducing CPU Usage.
I've actually looked into setting the framerate before and it didn't do what I want (which is to prevent the throttling from happening).
I'm not sure to what extent air is using the underlying flash player, but I've noticed this happening on the web browser too. This problem may not be AIR-specific, but I'm not entirely sure about that. Regardless, the use case is arguably stronger in AIR where desktop applications we write should be able to function in the background. I can imagine this being a problem for the mobile device, however.
I am trying to get up to speed on this thread - couple of questions:
1.) Is your application written in AS3, Flex, or HTML?
2.) On which platforms are you seeing the performance issue (Windows, Mac, Linux)?
3.) Are you manipulating Stage.frameRate (in AS3) or WindowedApplication.backgroundFrameRate (in Flex)?
4.) Do you have a sample you can provide that demonstrates the issue?
For my particular app, its written in flex and I'm seeing the issue on windows. I was modifying the stage framerate actually (I think), I didn't try the backgroundFrameRate.
I'm pretty sure its just being throttled as an optimization at some level (not sure where). In a separate instance, I was writing an air application written in flex (and windows) where I was NOT downloading something, but it was rendering a cpu-heavy graph. While I was trying to investigate why my graph was so slow, I looked at the process manager (ctrl + alt + del). It would always say it was at 5% cpu utilization, which I thought was highly suspicious (certainly didn't feel like 5%). I eventually realized, that simply having the process manager on top of the application causes the throttling to occur. All I had to do to prove it was check the "always on top" setting for the process manager, and then bring the focus back on my air app. It was going at 60% -80% cpu utilization!
I don't have a sample app, but to recreate one real quick, just have something continuously running (maybe a looped sequence of animation or downloading a huge file), and then bring up the process manager. You'll notice it'll say something low like 5%. Then, keep the process manager up while you focus back on the application (maybe on the side) - you'll notice the cpu utilization jump back to normal.
Thanks for looking into this
Glad to hear you're looking at this issue!
1.) My application is written in Flex4+AS3, not much Flex apart from a simple window
2.) I am seeing the issue on both Windows (at least XP and 7) and Mac OS 10.5
3.) Not manipulating the frame rates variables.
4.) I don' t have an easy application to test, as it is part of a bigger system and require other components and a specific server to test... I will have a look anyway if I can extract a simpler part of it, and fake server responses.
Moved the discussion to the Desktop Development forum