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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:04:54+00:00 2026-06-09T01:04:54+00:00

I have a photo editing app. When I import an image, it works fine

  • 0

I have a photo editing app. When I import an image, it works fine but, opening up the image for editing causes it to crash.

This is the logcat output:


08-04 20:56:16.973: E/dalvikvm-heap(336): 810000-byte external allocation too large for this process.
08-04 20:56:17.073: I/dalvikvm-heap(336): Clamp target GC heap from 25.289MB to 24.000MB
08-04 20:56:17.073: E/GraphicsJNI(336): VM won't let us allocate 810000 bytes

UPDATE::

    @Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == RESULT_LOAD_IMAGE && resultCode == RESULT_OK
            && null != data) {
        Uri selectedImage = data.getData();
        String[] filePathColumn = { MediaStore.Images.Media.DATA };

        Cursor cursor = getContentResolver().query(selectedImage,
                filePathColumn, null, null, null);
        cursor.moveToFirst();

        int columnIndex = cursor.getColumnIndex(filePathColumn[0]);
        String picturePath = cursor.getString(columnIndex);
        cursor.close();

        ImageView imageView = (ImageView) findViewById(R.id.ivPhoto);
        chosenBitmap = superDecodeFile(new File(picturePath));
        imageView.setBackgroundColor(0);
        Bitmap bMap =   Bitmap.createScaledBitmap(chosenBitmap, 500, 500, true);
        imageView.setImageBitmap(bMap);
    }

}

this is my onResult code .. so the choosenBitmap displays on the imageView ( ivPhoto )
I need to use .recycle();
so i free up some memory by recycling the already imageView ..
where do I use the .recycle(); ?
I tried to change the .setBackgroundColor(0); to .recycle(); but it doesn’t work

  • 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-09T01:04:55+00:00Added an answer on June 9, 2026 at 1:04 am

    This is a memory leak error.

    Your app is allocated a heap of size ~24MB. But the image you are trying to edit is larger than the heap size.

    This is happening because you are not freeing up the memory. Android’s Dalvik VM does not take care of GC-ing the native memory used by the app. So, when dealing with images in Android, you need to explicitly use recycle(). This frees up the native memory.

    For more deatils: Changing ImageView content causes OutOfMemoryError

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

Sidebar

Related Questions

I have a photo-galley which i show using fancybox, It works fine. i need
I have this photo gallery http://lifelistchase.com/japan-photo-gallery Each image is uploaded and inserted as a
I have a photo editing app where I want to provide a way for
I have photo gallery code that does image re-sizing and thumbnail creation. I use
So we have a photo like this (source: vkontakte.ru ) How to detect that
So for example we have real life photo. how to get (relativly to image
i am develop app in Blackberry which have photo functionality. i want to get
I have photo editing view that displays an OpenGL ES 2.0 view. I want
i have a photo gallery, and i really want to change each image on
I have a photo selection model, but for some reason whenever I call the

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.