9 Replies Latest reply on Aug 13, 2010 10:19 AM by chris.campbell

    Adobe AIR background process throttled at 5%

    baduncaduncan Level 1

      I'm creating an air application that downloads stuff from the web (through httprequest...irrelevant though).

       

      Oftentimes, while the content is being downloaded (roughly 200mb of data), the user will alt+tab away, putting the air app in the background process.  I've noticed that (at least in windows), this will cause the air app to download extremely slow since the cpu utilization seems to be throttled.  I realize this may be an OS-level optimization, but I don't see why browsers or say bit-torrent clients would exempt.

       

      This problem isn't really related to downloading, but I think this is potentially a common use-case for an air application.

       

      I've read an article about cpu throttling via the stage.framerate, but that doesn't seem to do the trick for me.

       

      Is it possible to forcibly set the cpu or at least turn off the throttling?

        • 1. Re: Adobe AIR background process throttled at 5%
          MartinRohart Level 1

          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!

          • 2. Re: Adobe AIR background process throttled at 5%
            Taylor Romero Level 1

            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.

            • 3. Re: Adobe AIR background process throttled at 5%
              baduncaduncan Level 1

              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.

              • 4. Re: Adobe AIR background process throttled at 5%
                chris.campbell Adobe Employee

                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.

                 

                Chris

                1 person found this helpful
                • 5. Re: Adobe AIR background process throttled at 5%
                  baduncaduncan Level 1

                  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.

                  • 6. Re: Adobe AIR background process throttled at 5%
                    thilgen Level 4

                    Howdy Folks.

                     

                    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?

                     

                    Thanks,

                     

                    Chris Thilgen

                    AIR Engineering

                    • 7. Re: Adobe AIR background process throttled at 5%
                      baduncaduncan Level 1

                      Hi

                       

                      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

                      • 8. Re: Adobe AIR background process throttled at 5%
                        MartinRohart Level 1

                        Hi Chris,

                         

                        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.

                         

                        Best,

                        Martin Rohart

                        • 9. Re: Adobe AIR background process throttled at 5%
                          chris.campbell Adobe Employee

                          Moved the discussion to the Desktop Development forum