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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:15:03+00:00 2026-05-13T14:15:03+00:00

I am finding that performance degrades after one or more screen rotations, and I

  • 0

I am finding that performance degrades after one or more screen rotations, and I presume that this is likely to be because an App’s main Activity is destroyed and recreated each time the screen is rotated and that my app must be leaking memory when that happens.

I have read that, contrary to what one might expect, not all the objects created by an app’s main Activity (or in classes called by that Activity) are destroyed when the activity is destroyed. Specifically, I think I have read (although I can’t now find where) that if the View uses a large bitmap member object then the Activity’s onDestroy() method should be over-ridden and the bitmap should be explicitly recycled.

Are there other objects that need to be destroyed or removed when the Activity is destroyed? What about Listeners? Is there a comprehensive tutorial or guide on this subject?

  • 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-13T14:15:03+00:00Added an answer on May 13, 2026 at 2:15 pm

    Is there a comprehensive tutorial or
    guide on this subject?

    Not really.

    Are there other objects that need to
    be destroyed or removed when the
    Activity is destroyed? What about
    Listeners?

    Bitmaps are unusual, in part because they use memory outside of the 16MB heap, if I understand the byzantine Android memory model correctly.

    Beyond large bitmaps, the biggest thing you really need to worry about are things that prevent normal garbage collection from working. Anything that holds onto the activity, directly or indirectly, from a static context will keep the activity from being garbage collected. Examples include:

    • static data members on classes (e.g., you rig up your own listener framework with one of your services, so your service holds onto a listener which holds onto your activity)
    • threads (e.g., you manually fork a background thread and do not terminate it)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have 2 instance in windows azure. I am finding that only one instance
I've built a simple .NET 4 custom downloader console app and am finding that
I am actually finding that chkContactType.Items is empty when I step through the code.
I'm finding that with dynamic linking, even with SxS, Windows Update will come along
I'm finding that the code that I write in my controllers is largely repetitive
I'm finding that when I link an executable against a static library (.a), the
I'm finding that std::sort is very slow with sorting only 1000 items. In class
Am using Math.round and I am finding that it will not return me any
Again I'm moving from Xcode 3 to 4 and finding that some things are
Working on a bunch of forms at the moment and I'm finding that I

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.