Difference in garbage collector behavior on Android device versus the emulator -
i'm testing application's memory usage on emulator. , problem on emulator app heap growing , growing, little bit of resources freed. , if no collections made cause outofmemory exception on big resolution screens.
i downloaded sony sdk , there emulator configuration xperia z has 1080x1920 resolution , default heap 64mb. think it's small heap size resolution because app uses 40mb starting up. on phone it's using 15mb of 64mb (res. 540x960). quite small heap size (might not real?) + gc behavior causing outofmemory quite fast.
on real device (i've tested on mine), gc working nicely, it's freeing resources no longer used, cannot predict if work on other phones.
should ignore how gc working on emulator or might app's problem?
growing heap on emulator indicates @ point have memory leak.
they common when send intents between different applications ( e.g select image gallery) . of device can handle such leaks no problem.
another reason heap grow up: inefficient memory operations. means @ time asking memmory ( e.g selected 5m image gallery, created inpuststream , keep in memory bitmap, asking 15+m emulator show hight heap grow, of devices show error).
if see heap grows - analyse memory usage , detect leaks. link
if dont detect strange can safely ignore heap warning.
note: heap show supplied space, not used.
Comments
Post a Comment