CasaOS icon indicating copy to clipboard operation
CasaOS copied to clipboard

[Bug] RAM usage not being displayed on a Raspberry Pi 4 2Gb

Open hazawer opened this issue 3 years ago • 9 comments

Describe the bug When in System status the CPU for running apps is being displayed but not for RAM

To Reproduce Steps to reproduce the behavior:

  1. Go to 'System status'
  2. Click on 'CPU'
  3. Click on 'RAM'
  4. See error

Expected behavior RAM usage for running apps should be displayed

If applicable, add screenshots to help explain your problem. casaos_cpu casaos_ram

Desktop (please complete the following information):

  • OS: Raspberry PI OS Lite 64-bit
  • Browser Brave
  • Version 0.4.3

Logs

run following command to collect corresponding logs:

sudo journalctl -xef -u casaos-gateway
sudo journalctl -xef -u casaos-user-service
sudo journalctl -xef -u casaos-local-storage
sudo journalctl -xef -u casaos.service

Additional context Add any other context about the problem here.

hazawer avatar May 26 '23 03:05 hazawer

You can try using the following commands to read RAM docker stats However, it seems that the Raspberry Pi official documentation does not support reading RAM directly. image

raller1028 avatar May 29 '23 03:05 raller1028

@hazawer I have the same issue with Raspberry Pi 4 4GB. This solution worked for me: https://github.com/docker/for-linux/issues/1112#issuecomment-699512425. @raller1028 Thank you for the guidance with the docker stats 😉

TomasValenta avatar Jun 10 '23 19:06 TomasValenta

@TomasValenta Thank you for your feedback, we will add this configuration to display the memory usage of the arm architecture in the future. @hazawer You can directly add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 in /boot/cmdline.txt Then restart to see the memory usage of the application. Attached is my test case. image

raller1028 avatar Jun 11 '23 17:06 raller1028

Yep, that worked a treat. ram_usage

hazawer avatar Jun 17 '23 15:06 hazawer

@TomasValenta Thank you for your feedback, we will add this configuration to display the memory usage of the arm architecture in the future. @hazawer You can directly add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 in /boot/cmdline.txt Then restart to see the memory usage of the application. Attached is my test case. image

worked like a magic ty

Levi-Michael avatar Mar 02 '24 14:03 Levi-Michael

Update:

Now you have to add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 in /boot/firmware/cmdline.txt With latest RpiOS ✅

shubhankartrivedi avatar Jun 14 '24 20:06 shubhankartrivedi

I have the similar issue my Host is

OS: Armbian (24.8.4) aarch64
Host: Radxa ZERO 3
Kernel: 6.1.75-vendor-rk35xx
Uptime: 5 hours, 51 mins
Packages: 1031 (dpkg)
Shell: bash 5.2.21
Terminal: /dev/pts/0
CPU: (4) @ 2.000GHz
Memory: 2653MiB / 3732MiB

I don't have /boot/cmdline.txt I do have armbianEnv.txt & boot.cmd

ioncubekh avatar Mar 26 '25 12:03 ioncubekh

For above system I edit /boot/armbianEnv.txt & added the solution to extraargs= line (space separated)

It arguments are properly passed to kernel but bug is still there with latest CasaOS.

dmesg logs:

[   15.630904] Kernel command line: root=UUID=eb6a27ef-3932-431f-92fd-e61fea75356c rootwait rootfstype=ext4 splash=verbose console=ttyS2,1500000 console=tty1 consoleblank=0 loglevel=1 ubootpart=f3aeb909-d11b-ec42-a52c-4507e474335c usb-storage.quirks=0x2537:0x1066:u,0x2537:0x1068:u,0x1058:0x25a2:u cma=256M cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1  cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory
[   15.631910] Unknown kernel command line parameters "splash=verbose ubootpart=f3aeb909-d11b-ec42-a52c-4507e474335c cgroup_enable=memory cgroup_memory=1", will be passed to user space.
.
.
.
[   18.261976] Run /init as init process
[   18.262019]   with arguments:
[   18.262028]     /init
[   18.262034]   with environment:
[   18.262039]     HOME=/
[   18.262044]     TERM=linux
[   18.262049]     splash=verbose
[   18.262054]     ubootpart=f3aeb909-d11b-ec42-a52c-4507e474335c
[   18.262060]     cgroup_enable=memory
[   18.262065]     cgroup_memory=1
[   18.263469]  mmcblk1: p1 p2

defencedog avatar Jun 01 '25 19:06 defencedog

Just add in the end of the code

"cgroup_enable=memory"

in /boot/firmwarte/cmdline.txt

the cmdline.txt will be like

console=serial0,115200 console=tty1 root=PARTUUID=5fe53d1e-02 rootfstype=ext4 fsck.repair=yes rootwait cgroup_enable=memory

RobertSamp avatar Aug 14 '25 20:08 RobertSamp