Memory Management on i.MX6 Android

Document created by Xinyu (eric) Chen Employee on Oct 9, 2012Last modified by Jodi Paul on Apr 24, 2013
Version 5Show Document
  • View in full screen mode

System Memory Usage and Configuration



This document describes i.MX android memory usage, layout and configuration for the entire system.

Total DDR memory usage


When i.MX Android is running, the DDR memory will be used by the following components:


  • Linux Kernel reserved space, including:
    • kernel text, data section and initrd
    • kernel page tables
  • Normal zone space managed by kernel’s MM (high memory zone is also included)
    • Used by application by brk() or malloc() in libc
    • Used by kernel by mm api, like: kmalloc, dma_alloc, vmalloc
  • Reserved memory for GPU drivers, used by
    • GPU libs, drivers
    • Android surface view, normal surface buffers
    • VPUs working buffer and bitstream (we allocate the VPU buffer from GPU driver to make a unify method of allocation)

  • Reserved space for framebuffer BG triple buffers
    • Framebuffer display are always required to have triple and large buffers

Memory layout


The following diagram shows the default memory usage and layout on i.MX6Q/DL platform.


Memory configuration


According to different type of product and different hardware configurations (ddr size, screen resolution, camera), customer may do some configurations to the memory layout and usage to optimize their system. Some memory reservation can be configured by command line or modifying the code.

  • The kernel reserved space cannot be adjusted. It is controlled by the kernel and the Normal zone size and it depends on the total DDR size and the reserved spaces.
  • Reserved GPU memory size can be adjusted by adding "gpumem=" parameters in kernel commandline. It's size is highly depends on the screen resolution, the video stream decoding requirement and the camera resolution, fps.


  • Reserved memory size for BG (background) framebuffer can be configured by command line
fbmem=<fb0 size>,<fb2 size>,<fb4 size>,<fb5 size>

For example:

If you have two display devices, one is XGA LVDS, the other is HDMI 1080p device (default 32bpp), you have to specify the BG buffer size for them:


The size is calculated by xres*yres*bpp*3:

10M ~= 1024x768x4(32bpp)x3(triple buffer)

24M ~= 1920x1080x4(32bpp)x3(triple buffer)

3 people found this helpful