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

The Archive Base Latest Questions

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

My app is basicly and image editor. There is a welcome page which opens

  • 0

My app is basicly and image editor. There is a welcome page which opens main activity with an intent. If orientation changes when main activity is working the memory consumption simply doubles up and remains that way. If i close the main activity turn back to welcome activity and start main activity again same problem does not occur. I think all these indicates memory leak, i have investigated myself but couldn’t find why app is leaking memory. I am using Application contexts and there is no static field in my app. I have tried to dump heap and analyze it with MAT, however i couldn’t find anything good. I was hoping someone could show me right direction to find the roots of memory leak or other possible explanation of the problem.

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

    Remember that in a JVM (and even in an I-can’t-believe-it’s-not-a-JVM like Davlik) there are many items which you use which aren’t exactly under your control. So, the correct approach is to find a way to verify that your code doesn’t memory leak, and then you will know that if memory blooms, it is likely some external subsystem, or some intended consequence of the application’s actual memory needs.

    From your description, it could easily be that the display rendering is simply keeping a lazily built cached memory buffer for each screen orientation.

    I only mention this because you have already (from your post) compared heap dumps, and if the heaps don’t show a trend in object accumulation, then it is likely some item contained within a library implementation. I know this is a very general rule of thumb, and doesn’t apply to most programs (as they probably do contain true memory leaks), but it is something that might be investigated when other options are exhausted.

    If you really want to verify that a particular library is keeping a cached copy of the screen orientation, you can always write up a small “test” program which is missing all of the confounding factors (like the rest of your program) and see how it performs on screen orientation shifts.

    As far as using VisualVM, it is excellent for detecting user space memory leaks; however, as it is running on a different architecture and implementation, it might miss platform specific library issues.

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

Sidebar

Related Questions

I'm working under a domain, and im making an app that changes ip from
I'm working on an iPhone app in which I manage some kind of agendas.
The app I'm working on is relatively simple but it is throwing memory warnings.
My app uses the android.support.v4.view.ViewPager class. For each page in the ViewPager, I want
The app Im working on uses gps and sometimes in the onResume when the
Basicly I'm making an image gallery that downloads from the web. So - when
I need to develop an app that is using multithreading. Basicly, I have a
'app name' specifies a minimum os of version 4.3, which is too high to
App Engine only allows you to use these formats for XMPP addresses: app-id@appspot.com anything@app-id.appspotchat.com
My app has many controls on its surface, and more are added dynamically at

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.