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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T14:42:53+00:00 2026-05-30T14:42:53+00:00

I am trying to write a simple app for android. I am trying to

  • 0

I am trying to write a simple app for android. I am trying to preload 7 jpg images each of size ~75KB and resoluton 768×480. When run on HTC Flyer it runs fine. When run on HTC Evo 3D it crashes. Apparently I am allocating too much memeory:

1658880-byte external allocation too large for this process.
Out of memory: Heap Size=6663KB, Allocated=4297KB, Bitmap Size=25278KB, Limit=32768KB
Trim info: Footprint=6663KB, Allowed Footprint=6663KB, Trimmed=452KB
VM won't let us allocate 1658880 bytes
Clamp target GC heap from 33.136MB to 32.000MB

which seems quite weird. Am I supposed to create smaller images? I seems unlikely given today’s high resolution screens. Am I suppose extend heap size? Well that’s only supported from Android 3.0. What is the proper solution?
Btw. code I used for preloading images is:

    stringsImages = new Drawable[]{
            getResources().getDrawable(R.drawable.strings0),
            getResources().getDrawable(R.drawable.strings1),
            getResources().getDrawable(R.drawable.strings2),
            getResources().getDrawable(R.drawable.strings3),
            getResources().getDrawable(R.drawable.strings4),
            getResources().getDrawable(R.drawable.strings5),
            getResources().getDrawable(R.drawable.strings6)
    };

To be sure to avoid possible confusion in calculations I am also using ~5MB additionally for calculations on audio data.

  • 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-30T14:42:54+00:00Added an answer on May 30, 2026 at 2:42 pm

    If you are running out of memory, try sub-sampling each drawable. This decreases the size of the image to save memory. See the docs here to understand how that works. I’ve done this and saved memory and not ever really seen any quality difference. Try running this code on each image:

    BitmapFactory.Options options=new BitmapFactory.Options();
    options.inSampleSize = 4; //the higher this number goes, the smaller the image gets
    Bitmap bitmap1 = BitmapFactory.decodeResource(getResources(), R.drawable.strings0, options);
    

    Then you can set each bitmap to an ImageView with imageView.setImageBitmap(bitmap1);

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

Sidebar

Related Questions

I'm trying to write a very simple app for Android. It should do 2
I am trying to write a very simple Android app. It takes in 2
I'm new to cakephp and trying to write a simple app with it, however
I'm trying to write a simple WPF app that has two ellipses, joined by
I am currently trying to write a very simple app that sends an object
I am trying to write a simple app in order to encrypt, and decrypt
I'm trying to write a really simple GUI app for inserting some records into
I'm trying to write a simple app, and follow the ApiDemos sample. My app
I am trying to write my first app- a simple application where the user
I'm trying to write a voip app for Android, using the Android SIP API

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.