开发者

Binder thread, Progress Bar and OutOfResourcesExceptions

I am stress testing my application. Here is my scenario

1) From my worker thread I show a progress bar ( I am passing a message to a handler created on the ui). I wait on my worker thread until the pd.show() is called, then I resume my worker thread

2) perform a operation on the worker thread

3) dissmis the progress dialog. Again, I am passing a message to a handler created on the ui and waiting the worker thread until the pd.dismiss is called

To stress test, I have put this in a 10000 iteration loop. Things work mostly fine on my Nexus one. On the galaxy tab and all motorola devices, after about 50 or so iterations my app is force closing. I see the BinderThreads s开发者_运维百科lowly grow to 16 and stop growing ( I know 16 is the max limit on the BinderThreads). On Nexus One, these are causing any problems later on. I got this in the logcat of galaxy tab and moto devices

 W/WindowManager( 1363): OutOfResourcesException creating surface
 I/WindowManager( 1363): Out of memory for surface!  Looking for leaks...
 W/WindowManager( 1363): No leaked surfaces; killing applicatons!

edit:After dismissing the progress dialog I am setting it to null, to make sure it is not holding on to anything.

Any ideas?

Thanks,

Veeresh


Maybe you haven't enough memory to create more surface!


In my case, I had a bug that was spawning maybe 95 dialog boxes, which are cousins to the progressbar indicator. So, this caused my out of resources exception


Try to disable hw rendering for this activity.

It could help in case exception caused by HW acceleration.

I've fixed similar problem recently in our application.

But it could be really hard to fix cause of this problem. :(

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜