Memory allocation

Started by kgolding, December 11, 2013, 09:04:04 pm

Previous topic - Next topic

kgolding

Hello,

Running Debian shows just 323MB of usable memory (top). I'm guessing the rest of the 512MB is allocated to the display? Is there a way to get back the memory for the OS to use please?

Kevin

olimex

yes, disable MALI and the FB
look the unofficial image there is headless configuration with no display which uses all the RAM

kgolding

Thanks for the reply, I've been googling and searching the forum and blog but I can only find an unofficial image for the A13 - any chance of a link to the image you're referring too please?

progmetalbg

There are some special kernel arguments which are described here:
http://linux-sunxi.org/KernelArguments

QuoteIt is possible to significantly reduce the amount of reserved memory assigned to various video devices at boot time, resulting in more free system memory, which is especiallly helpful for 512MB devices:

    sunxi_ve_mem_reserve=0 -- This eliminates the reserved memory for the video acceleration engine, saving 80MB. You can use this if you don't run accelerated video with programs such as VLC or XBMC.

    sunxi_g2d_mem_reserve=0 -- This eliminates the reserved memory for the 2D acceleration engine. You can use this if you don't have the G2D accelerated driver enabled in your xorg.conf. Even when G2D is enabled, it may not actually use any of this memory, so this setting may be safe (to be verified).

    sunxi_no_mali_mem_reserve -- This eliminates the reserved memory for the Mali400 3D GPU. If you do not have the Mali binary blob driver installed, it is safe to use this and save another 64MB.

    sunxi_fb_mem_reserve=16 -- This sets the amount of total reserved memory for the framebuffer to 16MB. The default is 32MB. Because of double buffering Mali may require more than 16MB of framebuffer, so generally only enable this if you don't have Mali installed. 16MB should be sufficient for the largest supported resolution (normally 1920x1080x32bpp).


You have to set these arguments in boot.scr or uEnv.txt. Here is an example of using boot.scr (with different arguments):

https://www.olimex.com/forum/index.php?topic=2015.msg9059#msg9059

You can check whether these arguments are applied at boot when you execute:

cat /proc/cmdline

My /proc/cmdline:

console=ttyS0,115200 root=/dev/mmcblk0p1 rootwait loglevel=8 panic=10 sunxi_ve_mem_reserve=0 sunxi_g2d_mem_reserve=0 sunxi_no_mali_mem_reserve sunxi_fb_mem_reserve=16

kgolding