fastfetch-cli/fastfetch

[BUG] Wrong Used Memory Detection on WSL2

Yikai-Liao opened this issue · 4 comments

I'm using debian12 on wls2, ans fastfetch tends to show a higher used memory than neofetch.

截图_20240715151105

I have further checked the used memory shown in gotop, htop and btm, and they tend to agree with neofetch.

I haven't check if it could be reproduced on a physical machine.

neofetch is wrong.

Fastfetch uses MemAvailable, which is calcuated directly by kernel.

Neofetch also uses this property. However the change introduced MemAvailable (Nov 3, 2020) in neofetch was committed after the latest release was cut (Aug 3, 2020).

You can try the latest neofetch source and it will print similar values as fastfetch.

You can also try free -h too.

free -h and top do show the same result. So it means btm, gotop, htop all show the wrong result? It's the first time I notice that top would show different memory usage compared to those "more beautiful" tools.

It seems that they get different definitions about used memory according to https://www.reddit.com/r/linuxquestions/comments/1bicj9b/why_htop_shows_less_memory_than_system_monitor/

It seems that they get different definitions about used memory

Yeah.