Sample Header Ad - 728x90

Puzzlement on memory statistics in Linux

0 votes
0 answers
55 views
I am working on an embedded Linux system (Kernel-5.10.186) on a SOC platform. Now I am doing long-time testing to collect memory statistics in the system. And I had a shell script to collect memory usage every 5 seconds, and I got following 2 outputs which made me puzzled.
================ No. 37 =================
              total        used        free      shared  buff/cache   available
Mem:          55096       15864       28336         100       10896       36220
Swap:             0           0           0
Active(anon):        148 kB
Inactive(anon):     3736 kB
AnonPages:          3848 kB
  108 dummyx.sh     3292 1056
  112 test_proc        178m 5528
  136 dbus-daemon      4144 1856
  171 adbd              35m 1620
  173 udc_daemon       3292 1288
  174 sh               3292 1392
  175 watchdog         3160 1080
test_proc's RSS: === 5660672
......
================ No. 2584 =================
              total        used        free      shared  buff/cache   available
Mem:          55096       15808       27612         100       11676       36272
Swap:             0           0           0
Active(anon):        132 kB
Inactive(anon):     3256 kB
AnonPages:          3332 kB
  108 dummyx.sh     3292 1056
  112 test_proc        178m 6220
  136 dbus-daemon      4144 1856
  171 adbd              43m 1860
  173 udc_daemon       3292 1288
  174 sh               3292 1392
  175 watchdog         3160 1080
test_proc's RSS: === 6369280
I am watching the memory usage of the system and test_proc, the test_proc RSS is increased from 5660672 to 6369280 by about 700KB, but the used and available memory are almost the same!! Why?
Asked by wangt13 (631 rep)
Jul 17, 2024, 06:59 AM
Last activity: Jul 17, 2024, 07:06 AM