12

I don't know if it is a critical issue or not. But, I need to get rid of the question marks in my mind.

I recently purchased a Raspberry Pi 3 board and while I was playing with it, I realized that meminfo shows the physical memory size much less(~880MB) than 1GB (which is specified on the official site).

root@mypi:~# cat /proc/meminfo 
MemTotal:         882780 kB
MemFree:          536068 kB
MemAvailable:     712180 kB

The amount of memory available to GPU is 16MB (which is the minimum allowed limit) checked twice on the related raspi-config menu item.

raspi-config -> Advanced Options -> Memory Split

Boot configuration also says that gpu_mem is 16MB.

root@mypi:~# cat /boot/config.txt | grep -i gpu
gpu_mem=16

For narrowing the problem space, here is the system info. By the way, system is up-to-date.

OS release:

root@mypi:~# cat /etc/os-release | grep PRETTY_NAME
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"

Kernel version:

root@mypi:~# uname -a
Linux mypi 4.4.23-v7+ #913 SMP Tue Oct 4 14:16:19 BST 2016 armv7l GNU/Linux

Kernel vmsplit configuration:

root@mypi:~# zcat /proc/config.gz | grep CONFIG_VMSPLIT | grep -v ^#
CONFIG_VMSPLIT_2G=y

So, I have 2 questions:

  • Where is the missing 128MB memory?
  • What causes this situation?
8
  • what is the OS you are using - raspbian/arch/other ? cat /etc/os-release should tell that. what the kernel version ? uname -a should give that. this should help narrow down the probable causes. did the rpi-update actually work or produce any warnings? Commented Oct 12, 2016 at 22:45
  • Detailed information is added to the question text.
    – vaha
    Commented Oct 12, 2016 at 22:57
  • It's likely the same problem as joan suggested in the other thread. Check with zcat /proc/config.gz|grep CONFIG_VMSPLIT. Only that the solution with rpi-update doesn't work because there is no newer kernel for the Pi3 yet. But you can recompile your kernel with 2GB/2GB memory split yourself.
    – Janka
    Commented Oct 12, 2016 at 23:35
  • 1
    This is perfectly normal, my Pi3 shows MemTotal: 882776 kB MemFree: 126868 kB MemAvailable: 689576 kB "In normal circumstances there is NEVER a need to run rpi-update as it always gets you to the leading edge firmware and kernel and because that may be a testing version it could leave your RPi unbootable". raspberrypi.org/forums/viewtopic.php?p=916911#p916911
    – Milliways
    Commented Oct 12, 2016 at 23:54
  • What does vcgencmd get_mem arm && vcgencmd get_mem gpu show?
    – Milliways
    Commented Oct 13, 2016 at 0:08

3 Answers 3

14

If the output of vcgencmd get_mem arm && vcgencmd get_mem gpu is

arm=880M
gpu=128M

This means that GPU is using 128M.

This can be verified/changed in raspi-config Advanced Options, although I have not reduced the GPU myself. I am going from memory, but I think this is the default, possibly related to Camera. At least you now know where your memory is.

3
  • Yes, it is all about the camera.
    – vaha
    Commented Oct 13, 2016 at 0:33
  • 880M and 128M add up to 1008M. Where is the other 16M?
    – v7d8dpo4
    Commented Oct 13, 2016 at 11:02
  • @v7d8dpo4 From the question: memory size for GPU is 16MB Commented Oct 13, 2016 at 16:43
10

First of all, I give my best regards to @Milliways for suggesting to check 2 simple commands.

vcgencmd get_mem arm && vcgencmd get_mem gpu

Where is the missing 128MB memory?

Even if both raspi-config and /boot/config.txt says that the amount of memory available to GPU is 16MB, actual values are 880MB for CPU, 128MB for GPU.

root@mypi:~# vcgencmd get_mem arm && vcgencmd get_mem gpu
arm=880M
gpu=128M

So, missing (actually not missing) 128MB memory is reserved for GPU.

What causes this situation?

Even /boot/config.txt includes the line gpu_mem=16, there is another line which enables the camera module.

root@mypi:~# cat /boot/config.txt | grep -i start_x
start_x=1

So, enabling camera module leads to 128MB memory reservation for GPU which is implicitly implied here.

In short, we can say that start_x=1 overrides gpu_mem=16.

After disabling the camera module by start_x=0, here is the memory values:

root@mypi:~# vcgencmd get_mem arm && vcgencmd get_mem gpu
arm=992M
gpu=16M
1
  • 3
    Yup, the camera defaults to a 128Mb reservation. It can work with lower splits (if I recall correctly, all the way down to 32Mb) but with more limited functionality (the less memory, the lower the resolutions you can handle and so forth). If the split is too small (as 16Mb is), it'll just default to 128.
    – Dave Jones
    Commented Oct 14, 2016 at 20:25
-1

Aside from the rpi-update option, there seems to another (possible) reason why the reported memory is less. This time its to do with the kernel space / user space memory splits. This post details the fix which involves tweaking the kernel build configuration and rebuilding it from the source code. One user reported success

by tesla01 » Thu Feb 05, 2015 8:04 pm Hi, I confirm that the 2G/2G option works when use custom kernel

Feb 5 19:17:12 raspberrypi kernel: [ 0.000000] Memory: 940776K/966656K available (5785K kernel code, 377K rwdata, 1760K rodata, 396K init, 771K bss, 25880K reserved)

Thanks :)

You will need to verify this is indeed the cause (by checking the value of CONFIG_VMSPLIT is either CONFIG_VMSPLIT=3G or CONFIG_VMSPLIT=2G) as some posts further down in that link report success like so

by birdman » Thu Feb 12, 2015 10:01 pm Just this minute had an update to libraspberrypi-* and raspberrypi-bootloader. kernel now 3.18.7-v7+. memory now reported by top as "KiB Mem: 998096"

Thanks!!

while some others didnt have the same results

Unfortunately I am not near my PI to verify any of these claims.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.