D
D
Denis2016-07-25 19:34:24
Java
Denis, 2016-07-25 19:34:24

Is it possible in android studio to view all existing objects?

Hello.
I have an activity in my application that, by timer, makes a request to the server every 5 seconds, and after the request, through the callback function, performs some actions.
The callback function is declared in the subclass.
Of course, with this scheme of work, when changing the activity, all this continues to work and the activity object is not deleted (there is little experience, I didn’t think about it right away), but these are memory leaks, etc.
Now I want to set a flag when calling onDestroy, which will turn off the timer. Which, in theory, should lead to the removal of the activity in the form of the removal of the last link to it.
But I'm not sure and want to check it out. Hence the question - are there any tools in android studio for such a check?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
AlexeyVD, 2016-07-26
@AlexeyVD

Log your network requests and see if they keep dropping after calling onDestroy() and changing the activity.

E
Evgeny Vasilenko, 2016-07-26
@Lucky_spirit

You need to make a memory dump and then view it with the help of special analyzers. I understand that you need to rely on this information: https://developer.android.com/studio/profile/trace...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question