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

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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T17:48:16+00:00 2026-06-06T17:48:16+00:00

In My applicatin occure this exception please suggest me How I can Rectify this

  • 0

In My applicatin occure this exception please suggest me How I can Rectify this Exception:-
I have been Tried to change in Imageloader code as but that not success.

 //decode image size
        BitmapFactory.Options o = new BitmapFactory.Options();
        o.inJustDecodeBounds = true;
        BitmapFactory.decodeStream(new FileInputStream(f),null,o);
        /*
         *  options.inJustDecodeBounds = true;
BitmapFactory.decodeResource(res, resId, options);

// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight);

// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;
return BitmapFactory.decodeResource(res, resId, options);

         * 
         * 
         * 
         * */
     // Calculate inSampleSize
        o.inSampleSize = calculateInSampleSize(o,100,100);
        o.inJustDecodeBounds = false;
        //Find the correct scale value. It should be the power of 2.
       // final int REQUIRED_SIZE=70;
        //int width_tmp=o.outWidth, height_tmp=o.outHeight;
  //            int scale=1;
//            while(true){
 //                if(width_tmp/2<REQUIRED_SIZE || height_tmp/2<REQUIRED_SIZE)
 //                    break;
 //                width_tmp/=2;
 //                height_tmp/=2;
//                scale*=2;
 //            }

               //decode with inSampleSize
           //            BitmapFactory.Options o2 = new BitmapFactory.Options();
              //            
            //            o2.inSampleSize=2;

        return BitmapFactory.decodeStream(new FileInputStream(f), null, null);

What wrong in above code because Exception occure in this section…

  06-28 10:53:36.676: E/dalvikvm-heap(595): 960000-byte external allocation too large for this process.
  06-28 10:53:36.806: E/GraphicsJNI(595): VM won't let us allocate 960000 bytes
 06-28 10:53:36.836: E/AndroidRuntime(595): FATAL EXCEPTION: AsyncTask #1
06-28 10:53:36.836: E/AndroidRuntime(595): java.lang.RuntimeException: An error occured while executing doInBackground()
 06-28 10:53:36.836: E/AndroidRuntime(595):     at android.os.AsyncTask$3.done(AsyncTask.java:200)
 06-28 10:53:36.836: E/AndroidRuntime(595):     at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:274)
 06-28 10:53:36.836: E/AndroidRuntime(595):     at java.util.concurrent.FutureTask.setException(FutureTask.java:125)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:308)
   06-28 10:53:36.836: E/AndroidRuntime(595):   at java.util.concurrent.FutureTask.run(FutureTask.java:138)
06-28 10:53:36.836: E/AndroidRuntime(595):  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1088)
    06-28 10:53:36.836: E/AndroidRuntime(595):  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:581)
    06-28 10:53:36.836: E/AndroidRuntime(595):  at java.lang.Thread.run(Thread.java:1019)
    06-28 10:53:36.836: E/AndroidRuntime(595): Caused by: java.lang.OutOfMemoryError: bitmap size exceeds VM budget
    06-28 10:53:36.836: E/AndroidRuntime(595):  at android.graphics.BitmapFactory.nativeDecodeStream(Native Method)
    06-28 10:53:36.836: E/AndroidRuntime(595):  at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:470)
    06-28 10:53:36.836: E/AndroidRuntime(595):  at com.rentfaster.utilities.ImageLoader.decodeFile(ImageLoader.java:161)
    06-28 10:53:36.836: E/AndroidRuntime(595):  at com.rentfaster.utilities.ImageLoader.getBitmap(ImageLoader.java:94)
    06-28 10:53:36.836: E/AndroidRuntime(595):  at com.rentfaster.handler.DetailPhotoHandler.imagefecher(DetailPhotoHandler.java:211)
   06-28 10:53:36.836: E/AndroidRuntime(595):   at com.rentfaster.handler.DetailPhotoHandler.characters(DetailPhotoHandler.java:153)
   06-28 10:53:36.836: E/AndroidRuntime(595):   at org.apache.harmony.xml.ExpatParser.text(ExpatParser.java:165)
   06-28 10:53:36.836: E/AndroidRuntime(595):   at org.apache.harmony.xml.ExpatParser.appendBytes(Native Method)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:518)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at or g.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:479)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:318)
 06-28 10:53:36.836: E/AndroidRuntime(595):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:275)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at com.rentfaster.home.PropertyDetail$Photostask.doInBackground(PropertyDetail.java:1174)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at com.rentfaster.home.PropertyDetail$Photostask.doInBackground(PropertyDetail.java:1)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at android.os.AsyncTask$2.call(AsyncTask.java:185)
  06-28 10:53:36.836: E/AndroidRuntime(595):    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:306)
  06-28 10:53:36.836: E/AndroidRuntime(595):    ... 4 more
  • 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-06T17:48:18+00:00Added an answer on June 6, 2026 at 5:48 pm

    You can see my answer on the same issue.

    If you want some more help, please let me know.

    Thank you 🙂

    UPDATE:

    You have used:

    BitmapFactory.decodeStream(new FileInputStream(f),null,o);
    

    This method creates a bitmap and returns the bitmap, you are not catching that bitmap.

    you should use something like:

    Bitmap bmp = BitmapFactory.decodeStream(new FileInputStream(f),null,o);
    

    You should create all the options first and then call the decodeStream() method. There is no effect of creating options after calling this method.

    You have used options, but always try to use all possible options that you can use, like following:

    options.inScaled = true;
    options.inPurgeable = true;
    
    // to scale the image to 1/8
    options.inSampleSize = 8;
    

    Always call the bitmap.recycle() method as soon as you have used bitmap.

    If all these solutions does not work, then as I have suggested, use MAT for eclipse plugin, because, certainly u’d be having a memory leak in your code.

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

Sidebar

Related Questions

I have application with this code: Module Startup <STAThread()> _ Public Sub Main() Try
I have a windows from application with a program.cs code like this: static class
We're seeing this exception occur in the following block of code in an ASP.NET
Please refer to Stumped SQL Exception for JDBC I have a similar error (listed
I'm not sure if this is a duplicate but if it is please feel
This question occured to me while programming a Android application, but it seems to
i have used impersonation in this application. whenever this error occurs i required to
Before reading please note that I've googled this and read a ton of articles
Not sure who is responsible for this error: Exception in thread main java.lang.OutOfMemoryError: PermGen
I am trying to open a SQLConnection and this exception occurs: Description: The application

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.