Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Adobe AIR Development

Reply
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Simulator freezing

A few more data points supporting high CPU usage, both within the simulator and on the host.

 

1. I've been trying dual-core mode for quite a while and can now confirm that I have had *no* freezes when using it, so far.

 

2. I've been watching my CPU usage using Windows Task Manager while running the sim.  I tried switching back to single-core mode but with a different setting for the virtualization engine mode (Automatic with Replay).  This resulted in the CPU usage dropping by about 40%, and my app ran for significantly longer than it had previously with single-core mode.  Only one data point here...

 

3. In dual-core mode, I've now confirmed that when my app crashes, it's generally or always because I've been doing "too much" on my machine at the same time.  With my test app, it would run for only a few minutes before dying if I was active on the machine, and sometimes for 10-15 minutes if I didn't touch anything.  I still had various programs open, however, like Skype, Thunderbird, Firefox, and Chrome.  The CPU load would from time to time spike as incoming email arrived, or some Flash widget or JavaScript in a web page updated something.

 

I tried shutting down almost everything, including the above programs.  

 

With my app running, CPU usage hovered consistently just under 20%, and my app just ran for several hours non-stop.

 

As a further test, when I got back to my computer I reopened Thunderbird, Chrome, and Firefox, and by the time my new email had loaded 15s later, the app had crashed and terminated again.

 

So to anyone still interested in using the new simulator, do the following:

 

1. switch to dual-core mode

2. terminate as many other apps on your host machine as possible

3. be gentle: interact minimally, and keep CPU usage low

4. consider smoothing out CPU usage in your app, at least for testing, by doing things like reducing the frame rate, spreading calculations out over a longer time, etc.

5. monitor CPU usage and, if your app dies, look at the graph to see whether you made it spike by whatever you just did before the crash... and try not to do that again.

 


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!
Highlighted
Developer
Posts: 6,473
Registered: ‎12-08-2010
My Device: PlayBook, Z10
My Carrier: none

Re: Simulator freezing

One extra thing... it's definitely not sound-related, but almost certainly CPU-related as @PBDev suggested.  

 

My app was both generating sound and doing some processor-intensive work.  I'd been testing with the sound off now, and was still getting the crashes.  Now I've "smoothed out" the processor-intensive work by doing it incrementally in an ENTER_FRAME handler (effectively working on one tile at a time in an image, rather than donig the whole image in one go), and since I've done that my crashes have been much rarer.


Peter Hansen -- (BB10 and dev-related blog posts at http://peterhansen.ca.)
Author of White Noise and Battery Guru for BB10 and for PlayBook | Get more from your battery!