Note that there are some explanatory texts on larger screens.

plurals
  1. POWeird memory leaking on Galaxy Nexus. Are there known issues?
    text
    copied!<p>I've run into an issue with a user of my apps on Galaxy Nexus. It is a game that is fairly graphically intensive, and essentially what occurs is that as he switches from activity to activity, the memory gradually runs out.</p> <p>This is a Galaxy Nexus with (as far as I know) stock Android 4.0.2. Excerpts from the LogCat:</p> <pre><code>D/.GameViewActivity( 3203): debug. ================================= D/.GameViewActivity( 3203): debug.heap native: allocated 6.01MB of 8.95MB (0.04MB free) in [.GameViewActivity] D/.GameViewActivity( 3203): debug.memory: allocated: 54.00MB of 64.00MB (14.00MB free) D/dalvikvm( 3203): GC_EXPLICIT freed 366K, 28% free 40426K/55623K, paused 4ms+4ms D/dalvikvm( 3203): GC_EXPLICIT freed 1K, 28% free 40425K/55623K, paused 1ms+4ms </code></pre> <p>A short while later (a matter of minutes), it will look like this:</p> <pre><code>D/.MainActivity( 3203): debug. ================================= D/.MainActivity( 3203): debug.heap native: allocated 6.92MB of 11.36MB (0.18MB free) in [.MainActivity] D/.MainActivity( 3203): debug.memory: allocated: 58.00MB of 64.00MB (1.00MB free) D/dalvikvm( 3203): GC_EXPLICIT freed 297K, 4% free 58119K/60359K, paused 1ms+5ms D/dalvikvm( 3203): GC_EXPLICIT freed 3K, 4% free 58116K/60359K, paused 1ms+5ms I/WindowManager(17943): createSurface Window{41fadf88 .MainActivity paused=false}: DRAW NOW PENDING D/OpenGLRenderer( 3203): Flushing caches (mode 0) I/ActivityManager(17943): Displayed .MainActivity: +556ms (total +743ms) D/dalvikvm(17943): GC_FOR_ALLOC freed 823K, 14% free 24118K/27911K, paused 86ms D/.GameViewActivity( 3203): debug. ================================= D/.GameViewActivity( 3203): debug.heap native: allocated 6.95MB of 11.36MB (0.15MB free) in [.GameViewActivity] D/.GameViewActivity( 3203): debug.memory: allocated: 58.00MB of 64.00MB (1.00MB free) D/dalvikvm( 3203): GC_EXPLICIT freed 11K, 4% free 58488K/60359K, paused 2ms+5ms D/dalvikvm( 3203): GC_EXPLICIT freed &lt;1K, 4% free 58487K/60359K, paused 2ms+4ms </code></pre> <p>Followed by a crash and out of memory.</p> <p>Now, I've gotten used to Android's hopeless memory management system resulting in unavoidable crashes for my games (it's - by far - the most reported error in the Android dashboard, and it doesn't matter how rigorously I excise the memory in the app - graphics + Android memory management = force closes). I only use Android components + SurfaceView, though heavily skinned/styled with custom graphics.</p> <p>The weird thing that catches my attention with this, however, is the phone.</p> <p>Now - firstly - it is a Galaxy Nexus, so pretty much the most advanced phone out there at the moment, with the most available memory for its apps. It is very strange that this phone, of all those out there, should have this kind of problem.</p> <p>Secondly, I have the exact same phone - also running 4.0.2 - and I use it as my primary testing phone. My user can get the game to crash literally in minutes; when I play the game, it can run for hours and will consistently have 20-25Mb of memory free.</p> <p>Thirdly, this app runs on tens of thousands of phones daily, so I am 100% sure that the app does <strong>not</strong> have any issues that should cause this kind of catastrophic memory leak that my user is seeing.</p> <p>In short - I'm stumped, completely and utterly.</p> <p>Any thoughts? Has anyone here seen something like this before? Are there known issues with the Galaxy Nexus that I've not heard of? Any strategies/questions/tests I might ask this user that might help pin down the problem here?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload