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 7911145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T13:08:37+00:00 2026-06-03T13:08:37+00:00

I want to load an image on android background = BitmapFactory.decodeResource(getResources(),R.drawable.hangmanbegin); background = Bitmap.createScaledBitmap(background,screenx,screeny,false);

  • 0

I want to load an image on android

background = BitmapFactory.decodeResource(getResources(),R.drawable.hangmanbegin);    
background =  Bitmap.createScaledBitmap(background,screenx,screeny,false);

The image is 800*1280 pixels , so if I’m correct it should use arround 3MB of memory space?
But my heap grows from 15MB to 29MB just at that phase , so no window or context leaking?

How is this explained? en what can you do about it?

Thnx in advance!

  • 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-03T13:08:39+00:00Added an answer on June 3, 2026 at 1:08 pm

    Bitmaps take up a lot of memory, especially for rich images like
    photographs. For example, the camera on the Galaxy Nexus takes photos
    up to 2592×1936 pixels (5 megapixels). If the bitmap configuration
    used is ARGB_8888 (the default from the Android 2.3 onward) then
    loading this image into memory takes about 19MB of memory (2592*1936*4
    bytes), immediately exhausting the per-app limit on some devices.

    from http://developer.android.com/training/displaying-bitmaps/index.html

    credit and below it a way to approach a fix https://stackoverflow.com/a/10127787/643500

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

Sidebar

Related Questions

I'm using BitmapFactory.decodeStream to load an image from a url in Android. I want
I want to load a blue/transparent image into an android drawable. I want the
I want to create a huge resolution Bitmap-image so that to load it into
<RelativeLayout android:id=@+id/widget android:layout_width=match_parent android:layout_height=wrap_content android:background=@drawable/my_background android:orientation=vertical > And now I want to change this
I'm trying to load a bitmap in Android which I want to tile. I'm
I want to load an image into the background of my Flex app. However,
I Want to load Image size 2550X3300 (i.e 1.7 Mb size), i have loaded
I want to load an image, resize it to a given size and after
I want to load the image URL from my NSMutableArray. Here is my Code:
i want to load some photos into my sd card image in the emulator.

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.