I was recently trying to use a large bitmap and put it into my app using decoderesources of the bitmap factory. I was wondering what the problem is and why I keep getting a VM out of budget error.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I am assuming this question is for Android.
If so, BitmapFactory leaks memory because the VM budget is full. The reason the VM budget is full is because the images are too large and the space for allocating such images is ONLY so much. So you either have to decrease the size of you image or scale it using createscaledbitmap(). This is not your fault, this is an Android bug. It has been asked too many times on this site.
Thanks,