Hi all,

I am dealing with a weird issue related to SurfaceView and memory. I have 
used MAT to make sure that the game I'm developing doesn't have any leak, 
nevertheless I find the following:

I have an activity (worlds) where the user can choose a map. Another 
activity (markit) is the game itself, with the map Id and all of that. 
Markit has my own GLView (which extends SurfaceView). The weird problem is 
that each time the activity finishes it doesn't get released (causing leak, 
and eventually OOM error).

Doing some research with MAT I found out that the problem is with the 
GLThread that SurfaceView has. This thread keeps the view from being 
collected.

As you can see in the pictures, stack2.png represents the image that there 
are 8 current activities in memory (after finishing the game) so that they 
are not getting flushed. On the picture stack4.png all the non-weak/soft 
relations are shown. I have to say that I have already given weak 
references to all the SurfaceView and Renderer related stuff, but it seems 
that something else (mContext, from View class) does not finish it.

Any hint or idea related to this bug or problem will be very appreciated. 
Thanks in advance!
Carlos

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

<<attachment: stack2.png>>

<<attachment: stack4.png>>

Reply via email to