- Home /
Android Memory Total / Guidelines ?
If I am aiming at Android devices with 512mb+, what is a reasonable memory budget to go for ? At the extreme, how much can you get away with before Android might jettison the app ?
Given that I have this target, how do I know if I am actually meeting it ? I have data from various sources that doesn't match up well, does anyone know which is the most accurate total ? (see below for the different attempts, which is the best/combination for a 'total' ?) :
Using 'adb shell dumpsys meminfo' (132mb)
133832 kB: Foreground 133832 kB: [process_name] (pid 26451)
Using 'adb shell dumpsys meminfo [process_name]' (135mb)
Shared Private Heap Heap Heap Pss Dirty Dirty Size Alloc Free ------ ------ ------ ------ ------ ------ Native 28 12 28 126876 123934 1881 Dalvik 2591 16044 2204 13255 12635 620 Cursor 0 0 0 Ashmem 6 12 0 Other dev 4 36 0 .so mmap 10854 2572 2056 .jar mmap 0 0 0 .apk mmap 72 0 0 .ttf mmap 0 0 0 .dex mmap 128 0 0
Other mmap 817 316 28
Unknown 120577 536 120564
TOTAL 135077 19528 124880 140131 136569 2501
Objects Views: 7 ViewRootImpl: 1 AppContexts: 2 Activities: 1 Assets: 3 AssetManagers: 3 Local Binders: 9 Proxy Binders: 15 Death Recipients: 0 OpenSSL Sockets: 0
SQL MEMORY_USED: 0 PAGECACHE_OVERFLOW: 0 MALLOC_SIZE: 0
Using custom written Unity code to get memory objects (115mb)
Time 11.69009 Frame 189 Level 0 Name L01_ MonoHeap 2.945313 MonoUsed 2.191406 System.GC.GetTotalMemory 2.191406 Profiler.usedHeapSize 89.23748 AllTextures 32.78072 All2DTextures 32.78072 AllAnims 26.68023 AllMeshes 45.41045 AllAudio 9.220627 AllMaterials 0.9634285 TotalResources 115.0555
Using Unity Profiler (89.4mb..115mb assets)
Total : 89.4mb Textures : 32.8mb Meshes : 45.8mb Materials : 1.0mb AnimationClips : 26.7mb AudioClips : 9.2mb
Same Level on iOS (170mb)
~170mb in the activity manager......
Confused...and grateful for any tips !
not just cpu but also gpu will vary wildly on android, your best bet is to test on a wide variety of devices and get firsthand experience... the profiler is useful for identifying bottlenecks...
Ok, I'm getting similar results from the (much improved) 4.1 memory profiler at ~133mb total.
Why is iOS so much more...I'll take a look once it re-imports.