java.lang.OutOfMemoryError:无法分配JNI Env总是android java

时间:2016-11-06 16:48:38

标签: java android

我正在运行AsyncTask

java.lang.OutOfMemoryError: Could not allocate JNI Env
                                                                         at java.lang.Thread.nativeCreate(Native Method)
                                                                         at java.lang.Thread.start(Thread.java:1063)
                                                                         at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:921)
                                                                         at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:989)
                                                                         at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1131)
                                                                         at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
                                                                         at java.lang.Thread.run(Thread.java:818)

我下次运行应用程序并执行相同的任务时出现此错误,第一次完成任务时没有任何问题且没有崩溃,当我重新按下并退出应用程序并返回并执行相同的任务时显示这个错误

[ 11-06 22:20:02.741  1174: 1219 D/         ]
                                                                 NULL == 

surf->write_back_color_buffer
11-06 22:20:02.741 1174-1219/com.package A/OpenGLRenderer: Encountered EGL error 12291 EGL_BAD_ALLOC during rendering
11-06 22:20:02.741 1174-1219/com.package A/libc: Fatal signal 6 (SIGABRT), code -6 in tid 1219 (RenderThread)

之前从来没有遇到过这个问题

1 个答案:

答案 0 :(得分:2)

好的,错误是由于输入流我忘了在一个模块中关闭,所以如果你们使用任何流,请仔细检查并确保关闭所有打开的流:)

相关问题