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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:17:05+00:00 2026-05-22T22:17:05+00:00

I load image from url. it’ ok, but when long time it error outofmemory:

  • 0

I load image from url. it’ ok, but when long time it error outofmemory: bitmap size exceeds vm budget. here my code

    BitmapFactory.Options bmOptions;
    bmOptions = new BitmapFactory.Options();
    bmOptions.inJustDecodeBounds = true;
    //from web
    try {
        Bitmap bitmap=null;
        InputStream is=new URL(url).openStream();
        BitmapFactory.decodeStream(is, null, bmOptions);
        is.close();
        BitmapFactory.Options o2 = new BitmapFactory.Options();
        o2.inSampleSize = 1;
        is = new URL(url).openStream();
        bitmap = BitmapFactory.decodeStream(is, null, o2);
        is.close();
        return bitmap;
    } catch (Exception ex){
       ex.printStackTrace();
       return null;
    }

help me please!!

  • 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-22T22:17:06+00:00Added an answer on May 22, 2026 at 10:17 pm

    Try using the sampleSize of BitmapFactory.Options, this will reduce the size in memory of your image (and the quality)

    But if your image is really too big, I think that’s there no miracle solution, the image is simply too big …

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

Sidebar

Related Questions

I want to load the image URL from my NSMutableArray. Here is my Code:
I'm using BitmapFactory.decodeStream to load an image from a url in Android. I want
I'm using initWithContentsOfURL of NSData to load an image from a url. However, I
I'm trying to use threading to load an image from a url. I have
I'm trying to load a gif image from a url into a java.util.image.Raster so
I've got some code to load an image from a URL, it seems to
I'm looking for an example of how to load an image from file and
Based on feedback from URL to load resources from the classpath in Java i
I've been looking for a way to download an image from a URL, preform
I am trying to load image from a remote server on the UIImageView in

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.