Android RenderScript FinalizerWatchdogDaemon Fatal Exception

对着背影说爱祢 提交于 2019-12-21 05:44:17

问题


I use RenderScript in my app to do several image processing tasks.

Sometimes, I randomly get the following exception:

10-10 15:27:04.479: E/AndroidRuntime(2113): FATAL EXCEPTION: FinalizerWatchdogDaemon
10-10 15:27:04.479: E/AndroidRuntime(2113): java.util.concurrent.TimeoutException: android.renderscript.Type.finalize() timed out after 10 seconds
10-10 15:27:04.479: E/AndroidRuntime(2113):     at android.renderscript.RenderScript.nObjDestroy(RenderScript.java:216)
10-10 15:27:04.479: E/AndroidRuntime(2113):     at android.renderscript.BaseObj.finalize(BaseObj.java:116)
10-10 15:27:04.479: E/AndroidRuntime(2113):     at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:187)
10-10 15:27:04.479: E/AndroidRuntime(2113):     at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:170)
10-10 15:27:04.479: E/AndroidRuntime(2113):     at java.lang.Thread.run(Thread.java:856)

All my RenderScript-Calls are enclosed by a Semaphore to prevent that the same script is running parallel. Can anybody tell me what this message means and how I can prevent it?


回答1:


Do you have a very long running kernel?

This thread is attempting to cleanup RS objects when the GC removes the java code reference. If there is a very long running kernel it may be blocked long enough to trigger what you are seeing. We don't allow objects to be modified by an external thread while a kernel is running, so in effect that external thread is blocked until kernel completion.



来源:https://stackoverflow.com/questions/19300154/android-renderscript-finalizerwatchdogdaemon-fatal-exception

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!