Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OOM exception when creating software bitmaps out of SVGs #91

Closed
0xMatthewGroves opened this issue Sep 8, 2019 · 0 comments · Fixed by #124
Closed

OOM exception when creating software bitmaps out of SVGs #91

0xMatthewGroves opened this issue Sep 8, 2019 · 0 comments · Fixed by #124
Labels
bug Something isn't working help wanted Issues that are up for grabs + are good candidates for community PRs

Comments

@0xMatthewGroves
Copy link

Latest version 0.7.0 while creating software bitmaps from SVG assets causing an OOM exception when loading SVGs in a recyclerview. Was able to reproduce this 100% of the time on memory constrained Nexus 5x device.

To reproduce, create a basic recyclerview that loads a unique SVG graphic from web, and start scrollin'.

java.lang.OutOfMemoryError: Failed to allocate a 16000012 byte allocation with 8363936 free bytes and 7MB until OOM
    at dalvik.system.VMRuntime.newNonMovableArray(Native Method)
    at android.graphics.Bitmap.nativeCreate(Native Method)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:831)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:808)
    at android.graphics.Bitmap.createBitmap(Bitmap.java:775)
    at coil.bitmappool.RealBitmapPool.get(RealBitmapPool.kt:77)
    at coil.drawable.SvgDrawable.draw(SvgDrawable.kt:50)
    at android.widget.ImageView.onDraw(ImageView.java:1246)
    at android.view.View.draw(View.java:16184)
    at android.view.View.updateDisplayListIfDirty(View.java:15180)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1765)
    at android.view.View.draw(View.java:16187)
    at android.view.View.updateDisplayListIfDirty(View.java:15180)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5018)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.draw(View.java:16187)
    at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4417)
    at android.view.View.updateDisplayListIfDirty(View.java:15180)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.draw(View.java:16187)
    at android.view.View.updateDisplayListIfDirty(View.java:15180)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at androidx.coordinatorlayout.widget.CoordinatorLayout.drawChild(CoordinatorLayout.java:1256)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:144)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:133)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1765)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.updateDisplayListIfDirty(View.java:15175)
    at android.view.View.draw(View.java:15954)
    at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
    at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
    at android.view.View.draw(View.java:16187)
	at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.jav
@0xMatthewGroves 0xMatthewGroves added the bug Something isn't working label Sep 8, 2019
@colinrtwhite colinrtwhite added the help wanted Issues that are up for grabs + are good candidates for community PRs label Sep 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Issues that are up for grabs + are good candidates for community PRs
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants