android-developers
[Arriba] [Todas las Listas]

[android-developers] Re: Tracking Abajo casos de Actividad múltiple en

To: android-developers@xxxxxxxxxxxxxxxx
Subject: [android-developers] Re: Tracking Abajo casos de Actividad múltiple en memoria
From: Streets Of Boston <flyingdutchie@xxxxxxxxx>
Date: Tue, 16 Sep 2014 05:56:48 -0700 (PDT)
Delivery-date: Thu, 18 Sep 2014 01:50:09 -0400
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20120806; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=XntIucXe0a/NYODbLxLyNuOr3BYZ3Mby6uC/xI+94rI=; b=spqQYVUGqzEd1Ajk4vhG74EZsUIYHHBChNNSYg3ZKcfa+2j4XlaQQPWJh+7gbAURHA SF3nOY1xueWn7hHd64zx6qPQ6rUwKwx+UbXuuSwLpBHBsYqZeMaytw2pXAoKPln7MLMj 8Z9U3wq+wfLwD8KCFrGBh6yFgypc1otKmk+uc5JJ6EZyMEb66v6VdXPI2JH9qsT+hZ6U lZotg1OKosGVePpVUCDyrJv3USfM6zrS4H/RXA8OJ/u2YrtlNldQppbXlRd6JILVytUL oDHhNrmY2P/IJqGT7sWWq64oLTAt7rXXcGWFeLrkZEI6haXxBjktjxXX3Dcm3vCv/Rc3 1h7g==
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :x-original-sender:reply-to:precedence:mailing-list:list-id :list-post:list-help:list-archive:sender:list-subscribe :list-unsubscribe:content-type; bh=XntIucXe0a/NYODbLxLyNuOr3BYZ3Mby6uC/xI+94rI=; b=sz17ZpGPJPBSMen7qhO1ftfeqOXJciTXGcm/U9s9hr/kr/r2vLL9HeTAu57V268In/ CzChI1iyQSZxJs86bcKvPhue24iW8z4lpk1HEwH/khKzynP1Ukm63FBWRVTcz8ECVsHr 5rGzmb+EbI/JZ4MXv2VOHI53/po48BQE8wEX1jLkzmKzlu+GCl9L5QNhUrZWfF064xxs neVFRjF0QQXk3sZhGmnUfdkWcZutxS2qqxNOslTotQydbtkzkd6ZJ095hKgfqnQNZbvt EdMlEANkCUyn9R0CE6vedrB3gcYabhziOPmu41xl5C+QhX0vzRtmuhhpa5t2/Ttro6m7 n0NQ==
Envelope-to: traductor@xxxxxxxxxxx
In-reply-to: <75fe8bab-ade3-4f65-b2f7-cc2bc18cb1a1@googlegroups.com>
List-archive: <http://groups.google.com/group/android-developer>
List-help: <http://groups.google.com/support/>, <mailto:android-developers+help@googlegroups.com>
List-id: <android-developers.googlegroups.com>
List-post: <http://groups.google.com/group/android-developers/post>, <mailto:android-developers@googlegroups.com>
List-subscribe: <http://groups.google.com/group/android-developers/subscribe>, <mailto:android-developers+subscribe@googlegroups.com>
List-unsubscribe: <mailto:googlegroups-manage+364598216046+unsubscribe@googlegroups.com>, <http://groups.google.com/group/android-developers/subscribe>
Mailing-list: list android-developers@xxxxxxxxxxxxxxxx; contact android-developers+owners@xxxxxxxxxxxxxxxx
References: <75fe8bab-ade3-4f65-b2f7-cc2bc18cb1a1@googlegroups.com>
Reply-to: android-developers@xxxxxxxxxxxxxxxx
Sender: android-developers@xxxxxxxxxxxxxxxx
Tuve un asunto similar una vez y yo *tracked lo abajo a la Vista#*setTag(*int 
llave, Objeto *tag) método.
En mi código, *setTag fue llamado con un *tag el valor que es un holding 
de objeto/*referencing un caso que tuvo niños *referring a niños de la 
Vista en el cual este *setTag fue llamado (*tag era un '*ViewHolder' caso). 

Versiones seguras de *Android implementa *setTag utilizando un **static *mapa de *WeakRereferences. 
Esto causó una Vista a nunca conseguir la basura recogida, desde 
el *tag aguantaría referencias a sus niños *whose padres  entonces 
punto (completamente arriba de) a aquella Vista otra vez. Y si una Vista no consigue 
la basura recogida, su Contexto (*i.*e. Actividad) nunca conseguiría la basura 
recogió.

Mirada si hay cualquier cosa aguantando encima a vuestra Actividad por la virtud de otros 
casos que son aguantado #por *incorrect uso de *WeakReferences.


En miércoles, septiembre 10, 2014 12:00:36 SOY *UTC-4, Nathan escribió:
>
> soy *fairly seguro he sido capaz de utilizar el *eclipse herramientas antes de que a pista 
> abajo filtraciones de memoria - yo incluso encontrado uno en *Google *Analytics. 
>
> Pero puedo no para la vida de mí imagina fuera.
>
> He descubierto que hay dos casos de Actividad *B en memoria cuándo 
> la actividad es cerrada. Puedo ver que con sé 
>
> bastante para saber que aquello es mal. 
>
> Pero lo que no puedo ver es POR QUÉ. Por qué es que actividad estúpida todavía en memoria 
> dos veces?
>
> Parezco para recordar que yo bien clic en algo y escoger Fusionar Camino 
> a Raíces de GC. 
>
> Entonces consigo algo así. 
>
>
> Nombre 
> de clase                                                                                       
> | *Ref. Los Objetos | Superficiales *Heap | *Ref. Superficial *Heap | Retuvo *Heap
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
> *com.*android.Interno.Política.*impl.*PhoneLayoutInflater @ 0*x42*d2*b0*d8 
> *Unknown                        |            1 |           40 
> |               536 |            64
> '- *mPrivateFactory, *mContext *MyActivity @ 0*x42*d28230|            1 
> |          536 |               536 |       127,336
> clase *com.*android.Interno.*os.*ZygoteInit @ 0*x41#uno21una18 Clase 
> de Sistema                               |            1 |          120 
> |               536 |         1,000
> '- *mResources *android.Contenido.*res.Recursos @ 
> 0*x41*aa7108                                         |            1 
> |          112 |               536 |         8,512
>    '- *mContext *android.*app.*ContextImpl @ 
> 0*x43009398                                              |            1 
> |          128 |               536 |        10,400
>       '- *mOuterContext *MyActivity @ 0*x42*d4*f008      |            1 
> |          536 |               536 |         3,864
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Bien que *PhoneLayoutInflater no tendría que ser aguantando encima a aquel contexto de una 
> actividad cerrada, pero no pienso controlo aquello. 
> Y sin duda que *ZygoteInit la cosa no tendría que ser aguantando un contexto en 
> un *static manera, pero no controlo que cualquiera. 
>
> Cualesquier consejos en encontrar las causas mejores?
>
> Nathan
>
>
> Nathan
>

-- 
recibiste este mensaje porque eres *subscribed al *Google
Grupos "*Android *Developers" grupo.
A correo a este grupo, envía *email a *android-developers@xxxxxxxxxxxxxxxx
A *unsubscribe de este grupo, envía *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx

Puesto que más opciones, visita este grupo en
*http://grupos.*google.*com/Grupo/*android-*developers?*hl=*en
--- 
Recibiste este mensaje porque eres *subscribed al *Google Grupos "*Android *Developers" grupo.
A *unsubscribe de este grupo y la parón que recibe *emails de él, enviar un *email a *android-*developers+unsubscribe@xxxxxxxxxxxxxxxx.
Puesto que más opciones, visita *https://grupos.*google.*com/*d/*optout.
I had a similar issue once and I tracked it down to the View#setTag(int 
key, Object tag) method.
In my code, setTag was called with a tag value being an object 
holding/referencing an instance that had children referring to children of 
the View on which this setTag was called (tag was a 'ViewHolder' instance). 

Certain versions of Android implement setTag using a *static *map of 
WeakRereferences. This caused a View to never get garbage collected, since 
the tag would hold references to its children whose parents would then 
point (all the way up) to that View again. And if a View doesn't get 
garbage collected, its Context (i.e. Activity) would never get garbage 
collected.

Look if there is anything holding on to your Activity by the virtue of 
other instances being held through incorrect usage of WeakReferences.


On Wednesday, September 10, 2014 12:00:36 AM UTC-4, Nathan wrote:
>
> I'm fairly sure I have been able to use the eclipse tools before to track 
> down memory leaks - I even found one in Google Analytics. 
>
> But I can't for the life of me figure out.
>
> I have found out that there are two instances of Activity B in memory when 
> the activity is closed. I can see that with 
>
> I know enough to know that that is bad. 
>
> But what I cannot see is WHY. Why is that stupid activity still in memory 
> twice?
>
> I seem to remember that I right click on something and choose Merge Path 
> to GC Roots. 
>
> Then I get something like this. 
>
>
> Class 
> Name                                                                                       
> | Ref. Objects | Shallow Heap | Ref. Shallow Heap | Retained Heap
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
> com.android.internal.policy.impl.PhoneLayoutInflater @ 0x42d2b0d8 
> Unknown                        |            1 |           40 
> |               536 |            64
> '- mPrivateFactory, mContext MyActivity @ 0x42d28230|            1 
> |          536 |               536 |       127,336
> class com.android.internal.os.ZygoteInit @ 0x41a21a18 System 
> Class                               |            1 |          120 
> |               536 |         1,000
> '- mResources android.content.res.Resources @ 
> 0x41aa7108                                         |            1 
> |          112 |               536 |         8,512
>    '- mContext android.app.ContextImpl @ 
> 0x43009398                                              |            1 
> |          128 |               536 |        10,400
>       '- mOuterContext MyActivity @ 0x42d4f008      |            1 
> |          536 |               536 |         3,864
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Well that PhoneLayoutInflater shouldn't be holding on to that context of a 
> closed activity, but I don't think I control that. 
> And definitely that ZygoteInit thing shouldn't be holding a context in a 
> static way, but I don't control that either. 
>
> Any tips on finding the causes better?
>
> Nathan
>
>
> Nathan
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@xxxxxxxxxxxxxxxx
To unsubscribe from this group, send email to
android-developers+unsubscribe@xxxxxxxxxxxxxxxx
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
--- 
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@xxxxxxxxxxxxxxxx.
For more options, visit https://groups.google.com/d/optout.
<Anterior por Tema] Tema Actual [Siguiente por Tema>