Curzibn / Luban

Luban(鲁班)—Image compression with efficiency very close to WeChat Moments/可能是最接近微信朋友圈的图片压缩算法
Apache License 2.0
13.56k stars 2.24k forks source link

OutOfMemoryError #323

Closed TxcA closed 5 years ago

TxcA commented 5 years ago

java.lang.OutOfMemoryError: Failed to allocate a 1228812 byte allocation with 1000168 free bytes and 976KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611) at top.zibin.luban.Engine.compress(Engine.java:78) at top.zibin.luban.Luban.get(Luban.java:152) at top.zibin.luban.Luban.access$1100(Luban.java:21) at top.zibin.luban.Luban$Builder.get(Luban.java:354) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.GetPicture(AttendanceFragment.java:282) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.run(AttendanceFragment.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

java.lang.OutOfMemoryError: Failed to allocate a 516108 byte allocation with 244944 free bytes and 239KB until OOM at java.io.ByteArrayOutputStream.expand(ByteArrayOutputStream.java:91) at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:201) at top.zibin.luban.Checker.toByteArray(Checker.java:187) at top.zibin.luban.Checker.isJPG(Checker.java:27) at top.zibin.luban.Engine.compress(Engine.java:82) at top.zibin.luban.Luban.get(Luban.java:152) at top.zibin.luban.Luban.access$1100(Luban.java:21) at top.zibin.luban.Luban$Builder.get(Luban.java:354) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.GetPicture(AttendanceFragment.java:282) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.run(AttendanceFragment.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

java.lang.OutOfMemoryError: Failed to allocate a 1228812 byte allocation with 1121120 free bytes and 1094KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611) at top.zibin.luban.Engine.compress(Engine.java:78) at top.zibin.luban.Luban.get(Luban.java:152) at top.zibin.luban.Luban.access$1100(Luban.java:21) at top.zibin.luban.Luban$Builder.get(Luban.java:354) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.GetPicture(AttendanceFragment.java:282) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.run(AttendanceFragment.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

java.lang.OutOfMemoryError: Failed to allocate a 1228812 byte allocation with 1018900 free bytes and 995KB until OOM at dalvik.system.VMRuntime.newNonMovableArray(Native Method) at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) at android.graphics.BitmapFactory.decodeStreamInternal(BitmapFactory.java:635) at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:611) at top.zibin.luban.Engine.compress(Engine.java:78) at top.zibin.luban.Luban.get(Luban.java:152) at top.zibin.luban.Luban.access$1100(Luban.java:21) at top.zibin.luban.Luban$Builder.get(Luban.java:354) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.GetPicture(AttendanceFragment.java:282) at com.jhxhzn.hecontrol.view.fragment.AttendanceFragment$onReadCardRun.run(AttendanceFragment.java:230) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:818)

java.lang.OutOfMemoryError: OutOfMemoryError thrown while trying to throw OutOfMemoryError; no stack available


'top.zibin:Luban-turbo:1.0.0' Android 5.1 ,瑞芯微Rk3288 多线程,单线程都出现过。