zetbaitsu / Compressor

An android image compression library.
7.08k stars 963 forks source link

java.lang.OutOfMemoryError #124

Open fajaranugrah opened 5 years ago

fajaranugrah commented 5 years ago

Failed to allocate a 3230412 byte allocation with 1117760 free bytes and 1091KB until OOM id.zelory.compressor.ImageUtil.decodeSampledBitmapFromFile

dalvik.system.VMRuntime.newNonMovableArray (VMRuntime.java)
android.graphics.BitmapFactory.nativeDecodeStream (BitmapFactory.java)
android.graphics.BitmapFactory.decodeStreamInternal (BitmapFactory.java:663)
android.graphics.BitmapFactory.decodeStream (BitmapFactory.java:639)
android.graphics.BitmapFactory.decodeFile (BitmapFactory.java:405)
id.zelory.compressor.ImageUtil.decodeSampledBitmapFromFile (ImageUtil.java:56)
id.zelory.compressor.ImageUtil.compressImage (ImageUtil.java:33)
id.zelory.compressor.Compressor.compressToFile (Compressor.java:60)
id.zelory.compressor.Compressor.compressToFile (Compressor.java:56)
android.app.Activity.dispatchActivityResult (Activity.java:6238)
android.app.ActivityThread.deliverResults (ActivityThread.java:3786)
android.app.ActivityThread.handleSendResult (ActivityThread.java:3833)
android.app.ActivityThread.access$1700 (ActivityThread.java:152)
android.app.ActivityThread$H.handleMessage (ActivityThread.java:1390)
android.os.Handler.dispatchMessage (Handler.java:102)
android.os.Looper.loop (Looper.java:135)
android.app.ActivityThread.main (ActivityThread.java:5538)
java.lang.reflect.Method.invoke (Method.java)
java.lang.reflect.Method.invoke (Method.java:372)
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run (ZygoteInit.java:960)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:755)

hello how to fixed this i use this version implementation 'id.zelory:compressor:2.1.0' thanks