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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T08:25:54+00:00 2026-06-06T08:25:54+00:00

According to Android Developers site, the Bitmap.recycle() method definition is: Free the native object

  • 0

According to Android Developers site, the Bitmap.recycle() method definition is:

Free the native object associated with this bitmap, and clear the reference to the pixel data

I’ve developed some applications which are creating / decoding a lot of bitmaps, and put the result bitmap objects to ImageViews. Sometimes I’ve got the famous exceptions such as:

bitmap size excceded vm budget

and

out of memory error

Also I’m sure I don’t have any memory leaks that can cause that.

After a lot of searches, I discoverd the “recycle” method, and used it to free the bitmap’s native memory when no longer needed. It seems like it helped a lot.

I’m asking if that’s something I’m supposed to do on this situation, because
I know the system is doing this anyway without calling it explicitly (is it? maybe I’m wrong).

Should I use this method in situations like this?

In what situations should I use this method?

Should I use this method at all?

thanks in advance.

UPDATE:

google posted this guide recently, which says:

On Android 2.3.3 (API level 10) and lower, using recycle() is recommended. If you’re displaying large amounts of bitmap data in your app, you’re likely to run into OutOfMemoryError errors. The recycle() method allows an app to reclaim memory as soon as possible.

  • 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-06T08:25:56+00:00Added an answer on June 6, 2026 at 8:25 am

    in what situations should I use this method?

    The Bitmaps are GC’ed by GC whenever it decides.But in some situations it may get delayed.
    And always remember thumb rule in java (Maybe it applies to othe P.L also).The speed of recycling objects by GC may not be same as speed of creating objects.So sometimes the GC is slow to in recycling.

    so recycle() means If you want to free memory ASAP you should call recycle()

    should I use this method at all??

    This is an advanced call, and normally need not be called, since the normal GC process will free up this memory when there are no more references to this bitmap.But if you are facing the issues like bitmap size exceeded vm budget or out of memory error then you need to use this.

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

Sidebar

Related Questions

According to this blogpost on android developers blog it should be doable to change
I implemented a ViewPager inside my app (according to this recent blog entry: http://android-developers.blogspot.com/2011/08/horizontal-view-swiping-with-viewpager.html
According to Android documentation, using the .getTime() method in the Android location will return
According to Android Developer Reference uptimeMillis() returns the number of milliseconds since boot, not
According to the Android Developers' Guide , it is possible to create a custom
I just set up eclipse to start android development according to this http://developer.android.com/sdk/installing.html .
According to this answer or the android's documentation there is several ways to get
According to the [Canvas.drawVertices Javadoc](http://developer.android.com/reference/android/graphics/Canvas.html#drawVertices(android.graphics.Canvas.VertexMode, int, float[], int, float[], int, int[], int, short[], int,
My android application needs to display time which has to be incremented according to
Possible Duplicate: change layout and template in zend dynamically according to the device(android tab,iphone,ipad)

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.