cats-oss / android-gpuimage

Android filters based on OpenGL (idea from GPUImage for iOS)
9.01k stars 2.27k forks source link

Out of memory exception #358

Open rahulpawar1989 opened 7 years ago

rahulpawar1989 commented 7 years ago

Hi i am getting this below error in my camera app only in android 4.4 devices

java.lang.OutOfMemoryError: at android.graphics.Bitmap.nativeCreate(Native Method:0) at android.graphics.Bitmap.createBitmap(Bitmap.java:922) at android.graphics.Bitmap.createBitmap(Bitmap.java:895) at android.graphics.Bitmap.createBitmap(Bitmap.java:862) at jp.co.cyberagent.android.gpuimage.bd.d(SourceFile:207) at jp.co.cyberagent.android.gpuimage.bd.a(SourceFile:123) at jp.co.cyberagent.android.gpuimage.GPUImage.b(SourceFile:314) at jp.co.cyberagent.android.gpuimage.GPUImage.c(SourceFile:275) at com.outthinking.selfie_camera.Preview$myTask.onPostExecute(SourceFile:316) at com.outthinking.selfie_camera.Preview$myTask.onPostExecute(SourceFile:134) at android.os.AsyncTask.finish(AsyncTask.java:632) at android.os.AsyncTask.access$600(AsyncTask.java:177) at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:645) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:136) at android.app.ActivityThread.main(ActivityThread.java:5584) at java.lang.reflect.Method.invokeNative(Native Method:0) at java.lang.reflect.Method.invoke(Method.java:515) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1268) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1084) at dalvik.system.NativeStart.main(Native Method:0)

please help me..

JamesXNelson commented 7 years ago

How large is your bitmap? There is a limit to the total size you can create.

Also, does this happen immediately, or after a few iterations?

If immediate, image too big. If eventually, you have a memory leak in your app you need to fix.