Multimedia memory guideline
- Multimedia related app has more chances to allocate multimedia memory directly or indirectly such as camera, album, VideoHighlight, video player, music player. For example, VideoHighlight gets memory buffer from mediaserver and the buffer is allocated from ION(in QCT platform) or NVMAP(in NV platform) by mediaserver. In this case, the additional multimedia memory usage should be counted into VideoHighlight’s memory usage since the additional multimedia memory usage doesn’t be counted into any process’ memory usage.
- Multimedia memory usage should also be counted into app’s memory usage and app’s overall memory usage including multimedia memory usage should meet defined memory budget.
QCT/MTK platform (ION)
2.1 ION memory manager
- ION is a generalized memory manager that Google introduced in the Android 4.0 ICS release to address the issue of fragmented memory management interfaces across different Android devices.
2.2 How to measure ION memory usage
- IonInUse: summary of all currently used ION memory
- IonTotal: IonInUse plus none-used ION memory pool(memory cache for improving ION allocation performance)
- Compare the difference of “IonInUse” value by below command
adb shell cat /proc/meminfo | grep IonInUse
## 2.3 How to breakdown ION memory usage ##
For QCT platform - Check the allocation breakdown by below command
adb shell cat /sys/kernel/debug/ion/heaps/system
For MTK platform - Check the allocation breakdown by below command
adb shell cat /sys/kernel/debug/ion/heaps/ion_mm_heap
3 NV platform (NVMAP)
3.1 NVMAP
- Nvmap is nvidia’s memory management driver. It handles memory allocation/free/handle exchange.
3.2 How to measure NVMAP memory usage
- Compare the difference of “total” value by below command
adb shell cat /sys/kernel/debug/nvmap/iovmm/clients
3.3 How to breakdown NVMAP memory usage
- Check the allocation breakdown by below command
adb shell cat /sys/kernel/debug/nvmap/iovmm/allocations