Open GoogleCodeExporter opened 9 years ago
java.lang.OutOfMemoryError: Failed to allocate a 16384012 byte allocation with
15854054 free bytes and 15MB until OOM
at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
at android.graphics.Bitmap.nativeCopy(Native Method)
at android.graphics.Bitmap.copy(Bitmap.java:557)
at com.robotium.solo.ScreenshotTaker.getBitmapOfView(ScreenshotTaker.java:246)
at com.robotium.solo.ScreenshotTaker.access$500(ScreenshotTaker.java:36)
at
com.robotium.solo.ScreenshotTaker$ScreenshotRunnable.run(ScreenshotTaker.java:37
4)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Original comment by cam9...@gmail.com
on 4 Jun 2015 at 12:22
[deleted comment]
Discussions on similar topics that may be relevant
http://stackoverflow.com/questions/3117429/garbage-collector-in-android
http://developer.android.com/training/displaying-bitmaps/index.html
Original comment by cam9...@gmail.com
on 5 Jun 2015 at 1:08
Thanks for reporting this.
Original comment by renasr...@gmail.com
on 5 Jun 2015 at 3:25
So it's possible that I may have been naturally hitting my JVM ceiling since
adding "android largeHeap="true"" to my manifest prevented the error. However
after looking at the source there may be some optimizations possible in the
screenshot process.
Also have you considered allowing the bitmap configuration to be set in the
takeScreenshot() method? RGB_565, for example, could reduce memory usage
Original comment by cam9...@gmail.com
on 5 Jun 2015 at 3:45
Original issue reported on code.google.com by
cam9...@gmail.com
on 4 Jun 2015 at 1:18