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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:05:40+00:00 2026-06-04T19:05:40+00:00

I receive big image (png, >30Mb) and create bitmap for it. And get java.lang.OutOfMemoryError.

  • 0

I receive big image (png, >30Mb) and create bitmap for it. And get java.lang.OutOfMemoryError. I try to catch such exception:

try {
    Bitmap bmp = BitmapFactory.decodeStream(someStream);
} catch (OutOfMemoryError e) {
    ;
}

With 2.2 SDK it works well. But with 2.3 app fails with uncatched exception. I don’t understand, why?

Thanks!

  • 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-04T19:05:41+00:00Added an answer on June 4, 2026 at 7:05 pm

    you need to re-size bitmap images before you could use them to display.
    Have a look at this tutorial about how to re-size bitmaps.

    EDIT
    alternatively you could try to save bitmap as file to filesystem using FileOutputStream. Something like this.

    byte[] imageData;
    FileOutputStream out = new FileOutputStream(file);
    out.write(imageData, 0, imageData.length);
    out.flush();
    out.close();
    

    decode the bitmap something like this, and scale/resize it as specified in above link.

    FileInputStream inputStream = new FileInputStream(file);
    BitmapFactory.decodeStream(inputStream, null, options);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a big std::vector so operator[] should receive long long rather
I receive the following error when building a basic form to create new data.
I have a big dataframe with columns such as: ID, time, OS, IP Each
I'm writing a WCF service which will be used to receive big files (mp3
I have to code a Java program that will receive messages from network and
I need to receive hex encoded single precision big endian float values coming from
I want to get from one big array some values received by SOAP service.
I want to receive multi file post from image uploader.( i use this )
What is the best way to create a webservice for accepting an image. The
I'd like to create a asp.net download page. I receive the file from a

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.