You are not logged in.
I found abnormal memory usage on my system,
I was running on approximately 150Mb in tty mode, now it's almost 500. Recently I updated my software.
All following output was right after reboot.
free -h total used free shared buff/cache available
Mem: 6.7Gi 497Mi 6.3Gi 1.1Mi 183Mi 6.2Gi
Swap: 5.8Gi 0B 5.8GiI noticed inconsistency in
htopand in
freeHtop give me 270Mb of memory in tty, but free says that 500Mb is used.
I tried to investigate with some other commands but to no avail.
cat /proc/meminfoMemTotal: 7038640 kB
MemFree: 6560696 kB
MemAvailable: 6525680 kB
Buffers: 45852 kB
Cached: 121980 kB
SwapCached: 0 kB
Active: 115332 kB
Inactive: 103472 kB
Active(anon): 36588 kB
Inactive(anon): 15476 kB
Active(file): 78744 kB
Inactive(file): 87996 kB
Unevictable: 0 kB
Mlocked: 0 kB
SwapTotal: 6062076 kB
SwapFree: 6062076 kB
Zswap: 0 kB
Zswapped: 0 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 51016 kB
Mapped: 42588 kB
Shmem: 1092 kB
KReclaimable: 29500 kB
Slab: 98960 kB
SReclaimable: 29500 kB
SUnreclaim: 69460 kB
KernelStack: 3344 kB
PageTables: 1192 kB
SecPageTables: 0 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 9581396 kB
Committed_AS: 147588 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 71628 kB
VmallocChunk: 0 kB
Percpu: 8704 kB
HardwareCorrupted: 0 kB
AnonHugePages: 16384 kB
ShmemHugePages: 0 kB
ShmemPmdMapped: 0 kB
FileHugePages: 0 kB
FilePmdMapped: 0 kB
CmaTotal: 0 kB
CmaFree: 0 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 0 kB
DirectMap4k: 177172 kB
DirectMap2M: 3954688 kB
DirectMap1G: 4194304 kBIn this post
unaccounted ram was calculated using formula
unaccounted = MemTotal - MemFree - Active - Inactive - Slab.
And in my case that's about 156Mb of unaccounted ram.
I have no idea what's using it.
I know that's sounds silly, but I'm just hoping it's not virus or smth.
If I run
ps auxI don't notice anything.
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.1 0.1 21096 12144 ? Ss 17:27 0:00 /sbin/init
root 2 0.0 0.0 0 0 ? S 17:27 0:00 [kthreadd]
root 3 0.0 0.0 0 0 ? I< 17:27 0:00 [rcu_gp]
root 4 0.0 0.0 0 0 ? I< 17:27 0:00 [rcu_par_gp]
root 5 0.0 0.0 0 0 ? I< 17:27 0:00 [slub_flushwq]
root 6 0.0 0.0 0 0 ? I< 17:27 0:00 [netns]
root 7 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/0:0-events]
root 8 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/0:0H-events_highpri]
root 10 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/u32:0-events_unbound]
root 11 0.0 0.0 0 0 ? I< 17:27 0:00 [mm_percpu_wq]
root 12 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/u32:1-events_unbound]
root 13 0.0 0.0 0 0 ? I 17:27 0:00 [rcu_tasks_kthread]
root 14 0.0 0.0 0 0 ? I 17:27 0:00 [rcu_tasks_rude_kthread]
root 15 0.0 0.0 0 0 ? I 17:27 0:00 [rcu_tasks_trace_kthread]
root 16 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/0]
root 17 0.0 0.0 0 0 ? I 17:27 0:00 [rcu_preempt]
root 18 0.0 0.0 0 0 ? S 17:27 0:00 [rcub/0]
root 19 0.0 0.0 0 0 ? S 17:27 0:00 [migration/0]
root 20 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/0]
root 21 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/0]
root 22 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/1]
root 23 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/1]
root 24 0.0 0.0 0 0 ? S 17:27 0:00 [migration/1]
root 25 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/1]
root 27 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/1:0H-events_highpri]
root 28 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/2]
root 29 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/2]
root 30 0.0 0.0 0 0 ? S 17:27 0:00 [migration/2]
root 31 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/2]
root 32 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/2:0-mm_percpu_wq]
root 33 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/2:0H-events_highpri]
root 34 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/3]
root 35 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/3]
root 36 0.0 0.0 0 0 ? S 17:27 0:00 [migration/3]
root 37 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/3]
root 39 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/3:0H-events_highpri]
root 40 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/4]
root 41 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/4]
root 42 0.0 0.0 0 0 ? S 17:27 0:00 [migration/4]
root 43 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/4]
root 45 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/4:0H-events_highpri]
root 46 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/5]
root 47 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/5]
root 48 0.0 0.0 0 0 ? S 17:27 0:00 [migration/5]
root 49 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/5]
root 51 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/5:0H-events_highpri]
root 52 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/6]
root 53 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/6]
root 54 0.0 0.0 0 0 ? S 17:27 0:00 [migration/6]
root 55 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/6]
root 57 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/6:0H-events_highpri]
root 58 0.0 0.0 0 0 ? S 17:27 0:00 [cpuhp/7]
root 59 0.0 0.0 0 0 ? S 17:27 0:00 [idle_inject/7]
root 60 0.0 0.0 0 0 ? S 17:27 0:00 [migration/7]
root 61 0.0 0.0 0 0 ? S 17:27 0:00 [ksoftirqd/7]
root 63 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/7:0H-events_highpri]
root 64 0.0 0.0 0 0 ? S 17:27 0:00 [kdevtmpfs]
root 65 0.0 0.0 0 0 ? I< 17:27 0:00 [inet_frag_wq]
root 66 0.0 0.0 0 0 ? S 17:27 0:00 [kauditd]
root 67 0.0 0.0 0 0 ? S 17:27 0:00 [khungtaskd]
root 68 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/u32:2-events_unbound]
root 69 0.0 0.0 0 0 ? S 17:27 0:00 [oom_reaper]
root 70 0.0 0.0 0 0 ? I< 17:27 0:00 [writeback]
root 71 0.0 0.0 0 0 ? S 17:27 0:00 [kcompactd0]
root 72 0.0 0.0 0 0 ? SN 17:27 0:00 [ksmd]
root 73 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/4:1-events]
root 74 0.0 0.0 0 0 ? SN 17:27 0:00 [khugepaged]
root 75 0.0 0.0 0 0 ? I< 17:27 0:00 [kintegrityd]
root 76 0.0 0.0 0 0 ? I< 17:27 0:00 [kblockd]
root 77 0.0 0.0 0 0 ? I< 17:27 0:00 [blkcg_punt_bio]
root 78 0.1 0.0 0 0 ? I 17:27 0:01 [kworker/6:1-events]
root 79 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/1:1-events]
root 81 0.0 0.0 0 0 ? I< 17:27 0:00 [tpm_dev_wq]
root 82 0.0 0.0 0 0 ? I< 17:27 0:00 [ata_sff]
root 83 0.0 0.0 0 0 ? I< 17:27 0:00 [edac-poller]
root 84 0.0 0.0 0 0 ? I< 17:27 0:00 [devfreq_wq]
root 85 0.0 0.0 0 0 ? S 17:27 0:00 [watchdogd]
root 86 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/6:1H-kblockd]
root 87 0.0 0.0 0 0 ? S 17:27 0:00 [irq/25-AMD-Vi]
root 88 0.0 0.0 0 0 ? S 17:27 0:00 [kswapd0]
root 89 0.0 0.0 0 0 ? I< 17:27 0:00 [kthrotld]
root 90 0.0 0.0 0 0 ? S 17:27 0:00 [irq/26-aerdrv]
root 91 0.0 0.0 0 0 ? S 17:27 0:00 [irq/27-aerdrv]
root 92 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/7:1-events_freezable]
root 93 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/3:1-cgroup_destroy]
root 94 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/5:1-events]
root 95 0.0 0.0 0 0 ? I< 17:27 0:00 [acpi_thermal_pm]
root 96 0.0 0.0 0 0 ? S 17:27 0:00 [xenbus_probe]
root 97 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/u32:3-phy0]
root 98 0.0 0.0 0 0 ? I< 17:27 0:00 [amd_iommu_v2]
root 99 0.0 0.0 0 0 ? I< 17:27 0:00 [mld]
root 100 0.0 0.0 0 0 ? I< 17:27 0:00 [ipv6_addrconf]
root 102 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/4:1H-kblockd]
root 108 0.0 0.0 0 0 ? I< 17:27 0:00 [kstrp]
root 109 0.0 0.0 0 0 ? I< 17:27 0:00 [zswap-shrink]
root 110 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/u33:0-rtw_tx_wq]
root 111 0.0 0.0 0 0 ? I< 17:27 0:00 [charger_manager]
root 140 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/0:1H-kblockd]
root 141 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/7:1H-kblockd]
root 165 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/5:1H-kblockd]
root 166 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/3:1H-kblockd]
root 167 0.0 0.0 0 0 ? I< 17:27 0:00 [nvme-wq]
root 168 0.0 0.0 0 0 ? I< 17:27 0:00 [nvme-reset-wq]
root 169 0.0 0.0 0 0 ? I< 17:27 0:00 [nvme-delete-wq]
root 170 0.0 0.0 0 0 ? I< 17:27 0:00 [nvme-auth-wq]
root 171 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/2:1H-kblockd]
root 172 0.0 0.0 0 0 ? I< 17:27 0:00 [kworker/1:1H-kblockd]
root 174 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/0:3-events]
root 176 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/6:2-events]
root 177 0.0 0.0 0 0 ? I< 17:27 0:00 [amdgpu-reset-de]
root 178 0.0 0.0 0 0 ? I< 17:27 0:00 [ttm]
root 179 0.0 0.0 0 0 ? I< 17:27 0:00 [amdgpu_dm_hpd_r]
root 180 0.0 0.0 0 0 ? I< 17:27 0:00 [amdgpu_dm_hpd_r]
root 181 0.0 0.0 0 0 ? I< 17:27 0:00 [amdgpu_dm_hpd_r]
root 182 0.0 0.0 0 0 ? I< 17:27 0:00 [amdgpu_dm_hpd_r]
root 183 0.0 0.0 0 0 ? I< 17:27 0:00 [dm_vblank_contr]
root 184 0.0 0.0 0 0 ? S 17:27 0:00 [card0-crtc0]
root 185 0.0 0.0 0 0 ? S 17:27 0:00 [card0-crtc1]
root 186 0.0 0.0 0 0 ? S 17:27 0:00 [card0-crtc2]
root 187 0.0 0.0 0 0 ? S 17:27 0:00 [card0-crtc3]
root 188 0.0 0.0 0 0 ? S 17:27 0:00 [gfx_low]
root 189 0.0 0.0 0 0 ? S 17:27 0:00 [gfx_high]
root 190 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.0.0]
root 191 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.1.0]
root 192 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.2.0]
root 193 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.3.0]
root 194 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.0.1]
root 195 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.1.1]
root 196 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.2.1]
root 197 0.0 0.0 0 0 ? S 17:27 0:00 [comp_1.3.1]
root 198 0.0 0.0 0 0 ? S 17:27 0:00 [sdma0]
root 199 0.0 0.0 0 0 ? S 17:27 0:00 [vcn_dec]
root 200 0.0 0.0 0 0 ? S 17:27 0:00 [vcn_enc0]
root 201 0.0 0.0 0 0 ? S 17:27 0:00 [vcn_enc1]
root 202 0.0 0.0 0 0 ? S 17:27 0:00 [jpeg_dec]
root 211 0.0 0.0 0 0 ? I 17:27 0:00 [kworker/7:2-events]
root 214 0.0 0.0 0 0 ? S 17:27 0:00 [jbd2/nvme0n1p8-8]
root 215 0.0 0.0 0 0 ? I< 17:27 0:00 [ext4-rsv-conver]
root 223 0.2 0.0 0 0 ? I 17:27 0:01 [kworker/2:3-mm_percpu_wq]
root 250 0.0 0.2 49648 16612 ? Ss 17:27 0:00 /usr/lib/systemd/systemd-journald
root 255 0.0 0.0 0 0 ? I< 17:27 0:00 [usbip_event]
root 256 0.0 0.0 0 0 ? I< 17:27 0:00 [iprt-VBoxWQueue]
root 257 0.0 0.0 0 0 ? S 17:28 0:00 [iprt-VBoxTscThread]
root 258 0.0 0.0 0 0 ? I 17:28 0:00 [kworker/5:2-events]
root 260 0.0 0.0 0 0 ? I 17:28 0:00 [kworker/4:2-cgroup_destroy]
root 271 0.0 0.1 33736 9344 ? Ss 17:28 0:00 /usr/lib/systemd/systemd-udevd
root 327 0.0 0.0 0 0 ? S 17:28 0:00 [irq/66-ELAN2204:00]
root 381 0.0 0.0 0 0 ? S 17:28 0:00 [ccp-1-q2]
root 382 0.0 0.0 0 0 ? S 17:28 0:00 [ccp-1-q3]
root 383 0.0 0.0 0 0 ? S 17:28 0:00 [ccp-1-q4]
root 384 0.0 0.0 0 0 ? S 17:28 0:00 [hwrng]
root 387 0.0 0.0 0 0 ? I< 17:28 0:00 [cryptd]
root 424 0.0 0.0 0 0 ? S 17:28 0:00 [irq/70-lis2dh12_accel-trigger]
root 433 0.0 0.0 0 0 ? I< 17:28 0:00 [cfg80211]
root 443 0.0 0.0 0 0 ? I< 17:28 0:00 [kworker/u33:2-hci0]
systemd+ 445 0.0 0.1 90964 8192 ? Ssl 17:28 0:00 /usr/lib/systemd/systemd-timesyncd
root 450 0.0 0.0 0 0 ? I 17:28 0:00 [kworker/u32:4-events_unbound]
root 456 0.5 0.0 0 0 ? S 17:28 0:03 [irq/77-rtw88_pci]
root 458 0.0 0.0 0 0 ? I 17:28 0:00 [kworker/1:2]
dbus 467 0.0 0.0 8944 4608 ? Ss 17:28 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
dhcpcd 468 0.0 0.0 3088 2432 ? Ss 17:28 0:00 dhcpcd: [manager] [ip4] [ip6]
root 469 0.0 0.1 50184 7936 ? Ss 17:28 0:00 /usr/lib/systemd/systemd-logind
root 470 0.1 0.0 3492 2604 ? S 17:28 0:00 dhcpcd: [privileged proxy]
dhcpcd 471 0.0 0.0 2888 1324 ? S 17:28 0:00 dhcpcd: [network proxy]
dhcpcd 472 0.0 0.0 2888 1196 ? S 17:28 0:00 dhcpcd: [control proxy]
root 474 0.0 0.0 0 0 ? I 17:28 0:00 [kworker/3:2-events]
root 481 0.0 0.6 139072 47092 ? Ssl 17:28 0:00 /usr/bin/python /usr/bin/firewalld --nofork --nopid
root 548 0.0 0.0 18408 5880 ? Ss 17:28 0:00 wpa_supplicant -q -B -P /run/wpa_supplicant-wlp2s0.pid -i wlp2s0 -D nl80211,wext -c/run/netctl/wpa_supplicant-wlp2s0.conf
polkitd 574 0.0 0.1 308572 9948 ? Ssl 17:28 0:00 /usr/lib/polkit-1/polkitd --no-debug
root 757 0.0 0.0 7964 4864 ? Ss 17:28 0:00 login -- anton
dhcpcd 766 0.0 0.0 3068 1548 ? S 17:28 0:00 dhcpcd: [BPF ARP] wlp2s0 192.168.0.187
anton 770 0.0 0.1 19992 11260 ? Ss 17:28 0:00 /usr/lib/systemd/systemd --user
anton 771 0.0 0.0 24564 5276 ? S 17:28 0:00 (sd-pam)
anton 779 0.1 0.0 10412 6400 tty1 Ss 17:28 0:00 -bash
root 1185 33.3 0.1 17544 7680 tty1 S+ 17:38 0:00 sudo ps aux
root 1186 0.0 0.0 17544 2204 pts/0 Ss 17:38 0:00 sudo ps aux
root 1187 100 0.0 11460 4736 pts/0 R+ 17:38 0:00 ps auxAlso I tried to check output of
smem -tk PID User Command Swap USS PSS RSS
779 anton -bash 0 3.0M 3.4M 5.5M
770 anton /usr/lib/systemd/systemd -- 0 2.1M 4.1M 11.3M
842 anton python /usr/bin/smem -tk 0 8.3M 10.5M 14.6M
-------------------------------------------------------------------------------
3 1 0 13.3M 18.0M 31.4M And result of same command but with sudo priviliges
PID User Command Swap USS PSS RSS
472 dhcpcd dhcpcd: [control proxy] 0 76.0K 226.0K 1.2M
471 dhcpcd dhcpcd: [network proxy] 0 76.0K 242.0K 1.3M
766 dhcpcd dhcpcd: [BPF ARP] wlp2s0 19 0 252.0K 407.0K 1.7M
468 dhcpcd dhcpcd: [manager] [ip4] [ip 0 424.0K 630.0K 2.5M
470 root dhcpcd: [privileged proxy] 0 492.0K 713.0K 2.7M
851 root sudo smem -tk 0 116.0K 817.0K 2.4M
467 dbus /usr/bin/dbus-daemon --syst 0 1.2M 1.8M 4.9M
757 root login -- anton 0 1.3M 2.1M 5.2M
469 root /usr/lib/systemd/systemd-lo 0 1.4M 2.2M 8.1M
445 systemd-timesync /usr/lib/systemd/systemd-ti 0 1.6M 2.4M 8.2M
771 anton (sd-pam) 0 1.0M 2.4M 5.3M
850 root sudo smem -tk 0 1.0M 2.7M 7.7M
779 anton -bash 0 3.0M 3.4M 5.5M
271 root /usr/lib/systemd/systemd-ud 0 2.7M 3.6M 9.6M
770 anton /usr/lib/systemd/systemd -- 0 2.1M 4.1M 11.3M
548 root wpa_supplicant -q -B -P /ru 0 3.7M 4.2M 5.9M
1 root /sbin/init 0 1.0M 4.3M 12.6M
574 polkitd /usr/lib/polkit-1/polkitd - 0 3.7M 5.5M 9.9M
250 root /usr/lib/systemd/systemd-jo 0 10.5M 11.3M 17.0M
852 root python /usr/bin/smem -tk 0 9.5M 11.7M 15.9M
481 root /usr/bin/python /usr/bin/fi 0 33.5M 38.1M 46.3M
-------------------------------------------------------------------------------
21 6 0 78.6M 102.7M 185.1M So in conclusion I have no idea why my system using so much ram just running tty after reboot.
Also I tried to look at this post, but issues seems very different https://bbs.archlinux.org/viewtopic.php?id=274520
Last edited by gaymaphrodite (2023-07-21 15:15:52)
Offline
And in my case that's about 156Mb of unaccounted ram.
Likely just device management, fits your previous observation of "I was running on approximately 150Mb in tty mode"
https://bbs.archlinux.org/viewtopic.php … 2#p2107162
The most important question is whether there's any movement, ie. whether you're losing memory over time.
Otherwise all high-level tools are abstractions of limited meaning.
You could also try to downgrade (procps-ng, otherwise the kernel would be relevant, you can also try the LTS behavior) and compare the reports under those conditions.
Offline
You could also try to downgrade (procps-ng, otherwise the kernel would be relevant, you can also try the LTS behavior) and compare the reports under those conditions.
You were correct, the issue was about free command.
procps-ng updated their algorithm for calculating used ram.
I did downgrade procps-ng from 4.0.3 version to 3.3.15 and this is the results.
total used free shared buff/cache available
Mem: 6.7Gi 265Mi 6.3Gi 1.0Mi 198Mi 6.2Gi
Swap: 5.8Gi 0B 5.8GiInstead of 500Mb it shows usage of only 265Mb, I would assume that I had it before.
Offline