Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6920731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:11:08+00:00 2026-05-27T10:11:08+00:00

I get bitmap size exceeds VM budget, eventually with my app. So I added

  • 0

I get “bitmap size exceeds VM budget”, eventually with my app. So I added all of these things to help alleviate the increasing memory footprint

 BitmapFactory.Options options = new BitmapFactory.Options();

        options.inTempStorage = new byte[32*1024];
        options.inDither=false;                     //Disable Dithering mode

        options.inPurgeable=true;                   //Tell to gc that whether it needs free memory, the Bitmap can be cleared

        options.inInputShareable=true;              //Which kind of reference will be used to recover the Bitmap data after being clear, when it will be used in the future


        options.inPreferredConfig = Bitmap.Config.RGB_565;

        Drawable pulled = BitmapDrawable.createFromResourceStream(null, null, conn.getInputStream(), "galleryImage", options);

I am also using weakhashmaps, recycling, System.gc()

and all this successfully PROLONGES the crash. where a device with a 32M heap initially would have only been able to handle a few images before crashing, now it can handle a dozen, but this doesn’t fix the problem. The problem is the BitMap method is leaking memory and simply will not clear.

How do I fix this? The images are of size 256×357

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T10:11:09+00:00Added an answer on May 27, 2026 at 10:11 am

    You should try to use drawable.setCallback(null); when you don’t need a drawable anymore, because even if you’re using a WeakHashMap, they can still be attached to the context through their callback attribute.

    See this

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

java.lang.OutOfMemoryError: bitmap size exceeds VM budget. i am updating images to a gridview from
I'm getting a lot of these exceptions from users: java.lang.OutOfMemoryError: bitmap size exceeds VM
Possible Duplicate: OutOfMemoryError: bitmap size exceeds VM budget :- Android Im in the process
I am getting a bitmap size exceeds VM budget error. I have read that
I am getting the 'java.lang.OutOfMemoryError: bitmap size exceeds VM budget' error... What I am
Hallo, there are a lot of stuff with bitmap size exceeds VM budget.but where
What is the best way to get the size (width and height) of an
When you get a bitmap from a resource for example with: Bitmap src =
i am able to get my bitmap set of points (as an array) using
I always get confused when I am about to use a bit map to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.