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

  • Home
  • SEARCH
  • 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 8381139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T16:37:46+00:00 2026-06-09T16:37:46+00:00

In: Decoding bitmaps in Android with the right size – it is posted that

  • 0

In: Decoding bitmaps in Android with the right size – it is posted that sampling down a bitmap may still lead to memory errors.

Is this issue still valid for newer versions of Android?

Does this mean that before sampling down, Android needs to load the full-size bitmap into memory? I believe this uses native memory, since image handling is implemented in native code.

  • 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-06-09T16:37:47+00:00Added an answer on June 9, 2026 at 4:37 pm

    Here is how you can get the available memory amount:

    Runtime.getRuntime().maxMemory()
    

    and here is an interesting blog about memory:
    http://codelog.dexetra.com/getting-around-android-memory-blues

    The problem with Android is ou never know when you may run ou of memory and the app just crashes. That is why you should try to avoid loading too large bimaps (I usually use maximum of 800 /600 or something like that depending on the screen orientation….)

    If loading several bitmaps like for gallery or other view group you should use weak reference:
    http://developer.android.com/reference/java/lang/ref/WeakReference.html

    Also if you look at the example in the link you provided the scaling first decodes only bounds and then decides on the scale to use.

    When you don’t need a bitmap anymore call:

     bitmap.recycle();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can I determine/calculate the byte size of a bitmap (after decoding with BitmapFactory)?
I am doing Video decoding (mpeg2, frame size 360x240) on Android phone with ARM-Cortex
I am reading up about Encoding and Decoding and I noticed that sometimes people
I try to break down the decoding algorithm wanted question into smaller questions. This
I want use many bitmap for my game canvas. I can't Recycle bitmaps, because
I'm decoding a very complex stored procedure and part of that is matching up
What's the easiest way of decoding a string such that: 'Bayern München' -> 'Bayern
I'm struggling with OOM errors when decoding images. This message is right on money
I have a painting application that is running out of memory on a few
I'm looking for a way of decoding a bitmap from file rotated (0,90,180,270 degrees).

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.