AndroidBeginnerJhon AndroidBeginnerJhon - 10 months ago 247
Java Question

java.lang.OutOfMemoryError: Could not allocate JNI Env always android java

i am running AsyncTask

java.lang.OutOfMemoryError: Could not allocate JNI Env
at java.lang.Thread.nativeCreate(Native Method)
at java.lang.Thread.start(
at java.util.concurrent.ThreadPoolExecutor.addWorker(
at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$

i get this error the next time i run the app and do the same task,first time task is completed without any porblem and no crashes and when i back press and exit the app and come back and do the same task it shows this error

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

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)

never had this problem before

Answer Source

okay that error was due to inputstream i forgot to close in one module,so if you guys use any stream,double check it and make sure you close all stream you open :)