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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:55:40+00:00 2026-05-28T13:55:40+00:00

I am running a stack of image filters and seem to be hitting some

  • 0

I am running a stack of image filters and seem to be hitting some memory issues.

At the beginning of the image processing I am using this much memory:

GC_FOR_MALLOC freed 3K, 45% free 3237K/5831K, external 47586K/49634K, paused 17ms

At the end I am using this much (after all processing is finished):

GC_EXTERNAL_ALLOC freed 5K, 16% free 16056K/18951K, external 51430K/52196K, paused 23ms

After I am finished with each bitmap I set it to recycle and to null:

someBitmap.recycle();
someBitmap = null;

Is there anything else I should be doing to them? Is there any cleanup I should do to the Canvas being used?

Also my filters are objects instantiated like:

BoxBlurFilter blurFilter = new BoxBlurFilter();

Is there anything I should do to release them? In iOS memory allocated with “new” I am responsible to free.

Sorry for the trivial memory management questions, but I am quite new to Android dev and things are quite different than iOS.

Thank you!

EDIT 2, I removed my full filter code.

  • 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-28T13:55:41+00:00Added an answer on May 28, 2026 at 1:55 pm

    So after setting the filter instances to null and all the byte arrays to null (in the code above and in the filter objects) I now have approximately the same size heap as I did before I run the filter:

    GC_EXPLICIT freed 5126K, 77% free 3243K/13703K, external 51430K/53478K, paused 18ms
    

    That means it went from 16mb being used to 3.2mb. Much better!

    So I guess the answer to my question is make sure you set everything to null if you want it to be freed.

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

Sidebar

Related Questions

When running a test using the Tornado AsyncHTTPTestCase I'm getting a stack trace that
I have a strange situation. I have a fairly memory intense process (image processing)
I'm having some performance issues calling CGContextDrawLayerAtPoint in iOS 4 that didn't seem to
https://i.stack.imgur.com/dtnpg.png Here is a screenshot of it. I am running svn on Windows 7,
Is there a call to determine the stack size of a running thread? I've
I'm running this query: SELECT TOP 1 [DVD Copy].[Stock No] FROM [DVD Copy] WHERE
Running Puppet v2.7.14 on CEntOs 6 and also using Apache/Passenger instead of WEBrick. I
I want to display a subtitle text, running over the top of an image,
I'd like to optimize this piece of code : public void PopulatePixelValueMatrices(GenericImage image,int Width,
I have read a few other posts on Stack Overflow and did some Googling

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.