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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T05:36:39+00:00 2026-06-07T05:36:39+00:00

I had window leak in my application activity which i fixed. But, when i

  • 0

I had window leak in my application activity which i fixed. But, when i tested the app using Memory Analyzer Tool in android – Histogram View, i find 2 instances of my activity.

Class Name | Objects | Shallow Heap | Retained Heap

.MATDemoActivity. | | |
com.pace.mat.MATDemoActivity | 2 | 368 |

Total: 1 entry (2,195 filtered)| | |

Since there is no memory leak, how can it be 2 objects ? Kindly help me understand the data in MAT result …. Thanks in advance

Please find the complete code and the related discussion in this link.

Android Memoryleak in code

=================

I found that when i start from Activity 1st -> 2nd -> 1st. Shallow Heap of 1st activity class = 2 and 2nd activity class = 1 and when i move from 1st -> 2nd -> 1st -> 2nd … Shallow Heap of 1st activity class = 1 and 2nd activity class = 2.

So i tried with launch modes. i set android:launchMode=”singleTask” for all activities. Now shallow heap for both the activities are equal to number of times i navigate to the page. But since multiple instances are not allowed in this launch mode, why am i not getting the shallow heap object count as 1 ?

Please share your ideas which would help me understand this better.

  • 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-07T05:36:41+00:00Added an answer on June 7, 2026 at 5:36 am

    In android, we can use Memory Analyser tool to capture the memory leaks(if any) in a particular code. We should generate the heap dump just before performing the operation responsible for leak and after completing the operation. Compare these 2 dumps and find which objects are taking memory and why it is not garbage collected.

    In my case mentioned above, i rather than analysing the dump generated after going to 2nd activity, i tried to compare the dumps before and after the activity. I got the required results clearly.

    Also, regarding MAT tool, it is good to try more than once and compare the dumps and choose a dump for analysis.

    Thanks friends.

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

Sidebar

Related Questions

I have one C code app. which i was building using MS-VS2005. I had
I had created one div window which is draggable,and created one child div (with
I'm currently looking for a good memory / leak detection tool for Windows. A
I had a UIAlertView window which worked fine in iPhone OS 3.2.3, with SDK
I recently had an app rejected from the app store because of Low Memory
We are having trouble with a memory leak that happens only when the application
NOTE: Originally had this listed as a memory leak. After looking into this deeper,
What memory leak detectors have people had a good experience with? Here is a
In my WPF app, I have particular Window which contains, amongst other controls, a
Eclipse can’t see my Android Device on Window.Previously I had been working fine.Suddenly 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.