Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
understanding available memory
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1602

PostPosted: Wed Jan 29, 2025 9:46 am    Post subject: understanding available memory Reply with quote

I am benchmarking gentoo vs alpine linux regarding memory usage
I have installed a pretty close installation for both OS:
gentoo: busybox ash as default shell, openrc, idw for wireless, kernel config: https://p.defau.lt/?H_zb7pvXZP2olicQWTJ6Xw
alpine: same as above but using the default alpine kernel

when i look at memory usage in alpine I see less used memory, but less available memory
Code:
cherry:~# free -m
              total        used        free      shared  buff/cache   available
Mem:           1922          59        1817           0          46        1710
Swap:          3844           0        3844


gentoo:
Code:
root@cherry $ free -m
               total        used        free      shared  buff/cache   available
Mem:            1920          91        1840           0          46        1828
Swap:              0           0           0
alpine:

i wanted to understand if the available memory is almost identical, and the used value is lower, shouldn't the available memory be higher?
where is this memory going? and how can I get reporting on it?
Back to top
View user's profile Send private message
pietinger
Moderator
Moderator


Joined: 17 Oct 2006
Posts: 5352
Location: Bavaria

PostPosted: Wed Jan 29, 2025 1:53 pm    Post subject: Reply with quote

The memory consumption and also how much is displayed as free memory is strongly dependent on the kernel configuration.

I would work with “atop -B” and “atop”. This presentation helped me a lot to better understand the output:
https://www.youtube.com/watch?v=ql1axx--8sI
_________________
https://wiki.gentoo.org/wiki/User:Pietinger
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54794
Location: 56N 3W

PostPosted: Wed Jan 29, 2025 5:47 pm    Post subject: Reply with quote

Adel Ahmed,

Perhaps you need to look at /proc/meminfo

In theory, all memory can be reused except
Code:
Unevictable:       10344 kB
Mlocked:           10480 kB
plus things belonging to the kernel.

I say in theory because when the kernel is forced to drop code that it would like to execute and reload it tater, things get intolerably slow.

You need to decide what counts as free and apply that metric consistently.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum