[NOT A BUG] Discrepancy in memory usage between system monitor & htop

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
hazel-bunny
Level 1
Level 1
Posts: 26
Joined: Fri Jan 29, 2021 3:52 am

[NOT A BUG] Discrepancy in memory usage between system monitor & htop

Post by hazel-bunny »

Code: Select all

System:    Host: hp-bw077 Kernel: 5.9.0-0.bpo.5-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1 Desktop: Cinnamon 4.8.6 
           tk: GTK 3.24.5 wm: muffin 4.8.1 dm: LightDM 1.26.0 Distro: LMDE 4 Debbie base: Debian 10.2 buster 
Machine:   Type: Laptop System: HP product: HP Laptop 14-bw0xx v: N/A serial: <superuser required> Chassis: type: 10 
           serial: <superuser required> 
           Mobo: HP model: 8324 v: 22.27 serial: <superuser required> UEFI: AMI v: F.28 date: 04/09/2019 
Battery:   ID-1: BAT0 charge: 23.8 Wh condition: 23.8/23.8 Wh (100%) volts: 16.5/14.6 model: HP Primary type: Li-ion 
           serial: N/A status: Full cycles: 214 
CPU:       Info: Dual Core model: AMD E2-9000e RADEON R2 4 COMPUTE CORES 2C+2G bits: 64 type: MCP arch: Excavator rev: 0 
           L2 cache: 1024 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm bogomips: 5988 
           Speed: 1093 MHz min/max: 1100/1500 MHz boost: enabled Core speeds (MHz): 1: 1093 2: 1071 
Graphics:  Device-1: Advanced Micro Devices [AMD/ATI] Stoney [Radeon R2/R3/R4/R5 Graphics] vendor: Hewlett-Packard 
           driver: amdgpu v: kernel bus ID: 00:01.0 chip ID: 1002:98e4 class ID: 0300 
           Device-2: Sunplus Innovation type: USB driver: uvcvideo bus ID: 1-1.3:3 chip ID: 1bcf:2c9b class ID: 0e02 
           Display: x11 server: X.Org 1.20.4 driver: loaded: amdgpu,ati unloaded: fbdev,modesetting,vesa 
           resolution: 1366x768~60Hz s-dpi: 96 
           OpenGL: renderer: AMD STONEY (DRM 3.39.0 5.9.0-0.bpo.5-amd64 LLVM 7.0.1) v: 4.5 Mesa 18.3.6 direct render: Yes 
Audio:     Device-1: Advanced Micro Devices [AMD/ATI] vendor: Hewlett-Packard driver: snd_hda_intel v: kernel bus ID: 00:01.1 
           chip ID: 1002:15b3 class ID: 0403 
           Device-2: Advanced Micro Devices [AMD] Family 15h Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 00:09.2 chip ID: 1022:157a class ID: 0403 
           Sound Server: ALSA v: k5.9.0-0.bpo.5-amd64 
Network:   Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard driver: r8169 v: kernel 
           port: e000 bus ID: 02:00.0 chip ID: 10ec:8168 class ID: 0200 
           IF: eno1 state: down mac: b4:b6:86:e5:3a:a9 
           Device-2: Intel Dual Band Wireless-AC 3168NGW [Stone Peak] driver: iwlwifi v: kernel port: e000 bus ID: 03:00.0 
           chip ID: 8086:24fb class ID: 0280 
           IF: wlo1 state: down mac: aa:7d:61:f2:83:4f 
           Device-3: Huawei E3372 LTE/UMTS/GSM HiLink Modem/Networkcard type: USB driver: cdc_ether,usb-storage 
           bus ID: 1-1.1:6 chip ID: 12d1:14dc class ID: 0806 
           IF: enx0c5b8f279a64 state: up speed: N/A duplex: N/A mac: 0c:5b:8f:27:9a:64 
Bluetooth: Device-1: Intel Wireless-AC 3168 Bluetooth type: USB driver: btusb v: 0.8 bus ID: 1-1.4:4 chip ID: 8087:0aa7 
           class ID: e001 
           Report: ID: hci0 state: down address: 5C:5F:67:7F:55:70 
Drives:    Local Storage: total: 466.24 GiB used: 77.63 GiB (16.6%) 
           ID-1: /dev/sda vendor: Western Digital model: WD5000LPCX-60VHAT0 size: 465.76 GiB speed: 6.0 Gb/s 
           serial: WD-WX51A28H84VP rev: 1A01 
           ID-2: /dev/sdb type: USB vendor: Hitachi model: HUAWEI TF CARD size: 488.5 MiB serial: Storage rev: 2.31 
Partition: ID-1: / size: 22.79 GiB used: 12.79 GiB (56.1%) fs: ext4 dev: /dev/sda8 
           ID-2: /boot/efi size: 256 MiB used: 94.6 MiB (36.9%) fs: vfat dev: /dev/sda1 
           ID-3: /home size: 91.15 GiB used: 64.8 GiB (71.1%) fs: ext4 dev: /dev/sda10 
Swap:      ID-1: swap-1 type: partition size: 8 GiB used: 0 KiB (0.0%) priority: -2 dev: /dev/sda9 
Sensors:   System Temperatures: cpu: 43.0 C mobo: N/A gpu: amdgpu temp: 40.0 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 259 Uptime: 22m wakeups: 1 Memory: 3.71 GiB used: 1.57 GiB (42.3%) Init: systemd v: 247 runlevel: 5 
           Compilers: gcc: 8.3.0 alt: 8 Packages: 2570 apt: 2548 flatpak: 22 Shell: Bash v: 5.0.3 running in: gnome-terminal 
           inxi: 3.3.00 
Application: System monitor (or maybe htop :? )
Version: dunno for system monitor (well, what's its package name? :( ) ; 2.2.0-1+b1 for htop. Other necessary things should be in that code bock
Description: htop shows me 1.38GB memory usage, whereas system monitor shows me 1.6GB at the time of writing this post. In the past, I've seen even more discrepancies (eg 884 vs 1.3GB). Btw I'm only running Ungoogled Chromium & KeepassXC as flatpaks while writing this (and also system monitor)
Reproducible? Yes. Happens for a long time
Logs: can't find any related to either in /var/log
Is this a bug? Could anybody help?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Hardware problems on LMDE? Solution:
sudo apt-get install -t buster-backports linux-image-amd64 firmware-linux firmware-misc-nonfree

To use a version of LMDE after EOL, replace mint's Firefox with debian's one
t42
Level 11
Level 11
Posts: 3742
Joined: Mon Jan 20, 2014 6:48 pm

Re: Possible bug causing discrepancy in memory usage between system monitor & htop

Post by t42 »

It is not a bug. The real memory usage is quite complicated and many tools have different approach to the reporting. Simple example, several programs could use a large shared library and have its memory usage size counted to both of them, so the library is being double-counted, which can be misleading if you don't know about that.
-=t42=-
User avatar
antikythera
Level 15
Level 15
Posts: 5721
Joined: Thu Jul 02, 2020 12:52 pm
Location: Cymru

Re: Possible bug causing discrepancy in memory usage between system monitor & htop

Post by antikythera »

htop and top are the reliable metric but pay more credence to the available RAM value than free.

https://www.linuxatemyram.com/
I’ll tell you a DNS joke but be advised, it could take up to 24 hours for everyone to get it.
hazel-bunny
Level 1
Level 1
Posts: 26
Joined: Fri Jan 29, 2021 3:52 am

Re: Possible bug causing discrepancy in memory usage between system monitor & htop

Post by hazel-bunny »

Thank you everyone for your replies!
Hardware problems on LMDE? Solution:
sudo apt-get install -t buster-backports linux-image-amd64 firmware-linux firmware-misc-nonfree

To use a version of LMDE after EOL, replace mint's Firefox with debian's one
Locked

Return to “Software & Applications”