Managing Your App's Memory
Android 使用paging,mmapping, 不使用swap
共享内存(Share Memory)
Zygote进程加载的系统资源,如Theme
Static data,如Dalvik code、app resources 、.so文件
匿名共享内存子系统Ashmem(Anonymous Shared Memory)
如:window surfaces use shared memory between the app and screen compositor, and cursor buffers use shared memory between the content provider and client
Android 使用paging,mmapping, 不使用swap
共享内存(Share Memory)
Zygote进程加载的系统资源,如Theme
Static data,如Dalvik code、app resources 、.so文件
匿名共享内存子系统Ashmem(Anonymous Shared Memory)
如:window surfaces use shared memory between the app and screen compositor, and cursor buffers use shared memory between the content provider and client
检查可用内存 getMemoryClass()
保守使用并尽快结束服务IntentService
UI不可见时,及时释放内存
onTrimMemory() (API level 14)与 onStop() 的区别
Keep in mind that an increase in bitmap resolution results in a corresponding (increase2) in memory needed, because both the X and Y dimensions increase.
使用Android系统提供的一些新的实现
SparseArray, SparseBooleanArray, and LongSparseArray比HashMap更有效率,占用的内存更少
Investigating Your RAM Usage
adb shell dumpsys meminfo <package_name>
为更容易发现内存泄漏,要制造内存压力
在不同使用状态下,多次转屏
应用间切换
使用Monkey
MAT(Memory Analyzer Tool)内存分析工具
http://my.eoe.cn/futurexiong/archive/1299.html
本文介绍了Android应用程序的内存管理策略,包括使用paging和mmapping技术、共享内存机制、内存检查方法以及如何通过优化来减少内存使用。同时提供了调查RAM使用情况的工具和技术,并探讨了避免内存泄漏的方法。

被折叠的 条评论
为什么被折叠?



