Is appears to a program inside the container that way, and it appears to the OS inside the container that is true, but the OS inside the container is a lightweight facade running on the host. When I run top in PiOS it shows all the processes running “inside the container” not as one docker process.
top - 11:38:30 up 5 days, 3:45, 4 users, load average: 1.31, 1.33, 1.29
Tasks: 210 total, 2 running, 207 sleeping, 0 stopped, 1 zombie
%Cpu(s): 28.8 us, 0.7 sy, 0.0 ni, 70.5 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 4045.2 total, 785.2 free, 871.1 used, 2476.0 buff/cache
MiB Swap: 100.0 total, 100.0 free, 0.0 used. 3174.1 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2215493 pi 20 0 762864 59360 28640 R 100.0 1.4 38,26 odometer
2219958 pi 20 0 770848 66528 29152 S 6.3 1.6 152:32.51 gopigo3_node
2220340 pi 20 0 762928 59904 28160 S 2.3 1.4 83:06.02 odometer
902079 root 20 0 0 0 0 I 1.3 0.0 0:01.93 kworker/2:2-events
2219965 pi 20 0 568512 22528 15872 S 0.7 0.5 3:47.64 teleop_node
2219972 pi 20 0 763312 59904 28160 S 0.7 1.4 16:14.99 joint_state_pub
17 root 20 0 0 0 0 I 0.3 0.0 1:37.58 rcu_preempt
2219963 pi 20 0 657120 28160 19456 S 0.3 0.7 11:27.45 joy_node
2219968 pi 20 0 572000 24576 17408 S 0.3 0.6 4:02.80 robot_state_pub
1 root 20 0 169120 10656 7680 S 0.0 0.3 1:15.69 systemd
and top inside the container:
top - 11:42:05 up 5 days, 3:48, 0 users, load average: 1.25, 1.29, 1.27
Tasks: 18 total, 2 running, 16 sleeping, 0 stopped, 0 zombie
%Cpu(s): 28.2 us, 0.6 sy, 0.0 ni, 71.2 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 4045.2 total, 784.8 free, 784.4 used, 2476.0 buff/cache
MiB Swap: 100.0 total, 100.0 free, 0.0 used. 3173.6 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
9071 pi 20 0 762864 59360 28640 R 100.0 1.4 2310:34 odometer
9924 pi 20 0 770848 66528 29152 S 6.6 1.6 152:46.68 gopigo3_node
10013 pi 20 0 762928 59904 28160 S 3.7 1.4 83:13.58 odometer
9932 pi 20 0 763312 59904 28160 S 0.7 1.4 16:16.51 joint_state_pub
9925 pi 20 0 657120 28160 19456 S 0.3 0.7 11:28.45 joy_node
9927 pi 20 0 568512 22528 15872 S 0.3 0.5 3:47.98 teleop_node
1 pi 20 0 2432 1024 1024 S 0.0 0.0 0:00.02 sh
44 pi 20 0 4960 3584 3072 S 0.0 0.1 0:00.00 bash
54 pi 20 0 5088 3584 3072 S 0.0 0.1 0:00.48 bash
99 pi 20 0 5088 3584 3072 S 0.0 0.1 0:00.25 bash
9070 pi 20 0 50656 30720 14848 S 0.0 0.7 0:00.17 ros2
Just noticing the odometer is hogging - something wrong there, and there are two odometer processes - something else wrong there.
Also note the memory in the container is not separate from the memory outside. All the host memory and all the host processor is available and used by the containerized processes - Docker OS is a very lightweight facade.
Fixed Odometer - only 4% now
top - 12:00:42 up 5 days, 4:07, 4 users, load average: 0.39, 0.81, 1.05
Tasks: 212 total, 2 running, 209 sleeping, 0 stopped, 1 zombie
%Cpu(s): 4.5 us, 0.7 sy, 0.0 ni, 94.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
MiB Mem : 4045.2 total, 836.8 free, 819.3 used, 2475.7 buff/cache
MiB Swap: 100.0 total, 100.0 free, 0.0 used. 3225.9 avail Mem
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
2219958 pi 20 0 770240 67040 29664 R 8.6 1.6 153:59.55 gopigo3_node
946336 pi 20 0 762352 59392 28160 S 4.0 1.4 0:02.10 odometer
942520 root 20 0 0 0 0 I 1.3 0.0 0:00.25 kworker/2:0-events_freezable
2219972 pi 20 0 762704 59904 28160 S 1.0 1.4 16:24.47 joint_state_pub
2219963 pi 20 0 656512 28160 19456 S 0.7 0.7 11:34.06 joy_node
1257 lightdm 20 0 701568 40320 28256 S 0.3 1.0 2:43.94 wireplumber
946270 vnc 20 0 2416 0 0 S 0.3 0.0 0:00.05 sh
2219965 pi 20 0 567904 22528 15872 S 0.3 0.5 3:49.92 teleop_node
1 root 20 0 169120 10656 7680 S 0.0 0.3 1:15.89 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:00.15 kthreadd