Out of memory exception due to large bitmap size

前端 未结 2 421
时光说笑
时光说笑 2020-11-29 11:11

I have a problem of out of memory due to limited virtual memory heap size.
Here is my code for fetching bitmap from server:

@SuppressWarnings(\"unchecked         


        
2条回答
  •  执笔经年
    2020-11-29 11:29

    BitmapFactory.decodeByteArray() creates the bitmap data in the Native heap, not the VM heap. See BitmapFactory OOM driving me nuts for details.

    You could monitor the Native heap (as per BitmapFactory OOM driving me nuts) and downsample if you're running short of space.

提交回复
热议问题