Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect memory in title #21

Open
StackKorora opened this issue Sep 28, 2020 · 0 comments
Open

Incorrect memory in title #21

StackKorora opened this issue Sep 28, 2020 · 0 comments

Comments

@StackKorora
Copy link

Snipping out bits that aren't relevant, but I noticed the memory calculations aren't correct.

$ bcmstat.sh J1mrg -oGPUfree,MEMfree
  Config: v0.5.5, args "J1mrg -oGPUfree,MEMfree", priority lowest (+19)
   Board: 4 x ARMv7 cores available, ondemand governor (Pi4 Model B rev 1.1, BCM2838 SoC with 4GB RAM by Sony UK)
  Memory: 1024MB (split 704MB ARM, 320MB GPU)
<snip>
Time     GPUMem Free MemFreeKB / %used
======== =========== =================
20:17:08 295M ( 98%) 3,483,968 /  7.1%

bcmstat sees two different memory configurations and the Board matches what it actually polls via /proc/meminfo. The one in the header is wrong. The code that does it is:

  MEM_ARM = int(vcgencmd("get_mem arm")[:-1])
  MEM_GPU = int(vcgencmd("get_mem gpu")[:-1])
  MEM_MAX = MEM_ARM + MEM_GPU

The documentation for vcgencmd says:

On a Raspberry Pi 4 with greater than 1GB of RAM, the arm option is inaccurate. This is because the GPU firmware which implements this command is only aware of the first gigabyte of RAM on the system, so the arm setting will always return 1GB minus the gpu memory value. To get an accurate report of the amount of ARM memory, use one of the standard Linux commands, such as free or cat /proc/meminfo

MEMTOTAL is actually already pulled. I was thinking about swapping this value in for the header.

Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant