View previous topic :: View next topic |
Author |
Message |
L1NTHALO n00b
Joined: 27 Aug 2024 Posts: 14
|
Posted: Sun Oct 20, 2024 9:22 pm Post subject: How does RAM usage work? |
|
|
I always want to keep my systems as minimal as possible, that's a huge reason why I switched to gentoo.
On of the most fun parts so far has been checking my idle RAM usage after installing an OS (arch, windows, gentoo etc), the lower the better.
However I have realized some inconsistencies. First of all Gentoo is supposed to be minimal but I often get the same or just slightly higher RAM usage on arch. Sometimes gentoo uses more RAM.
Also on my different gentoo installs memory usage varies. For example kernels that I deemed more minimal than others use the same or more RAM than bigger kernels. And I noticed that systems with more GB of ram use more of it idle.
I used Hyprland, minimal use flags and openrc on all these systems (other than systemd on arch).
Now I know that caching and memory allocation exists but how does it work? For example I noticed that ram usage spikes when starting the system and then gets lower with time (if doing nothing).
Is more RAM getting allocated if you have more system RAM available?
Also do optimizations such as -O3 -lto and other aggressive CFLAGS increase ram usage?
And yes I'm aware that less ram usage =/= better but it's fun to look at fastfetch and see only 200MB ram usage in idle (tty). |
|
Back to top |
|
|
eccerr0r Watchman
Joined: 01 Jul 2004 Posts: 9802 Location: almost Mile High in the USA
|
Posted: Sun Oct 20, 2024 9:54 pm Post subject: |
|
|
compare software versions including kernel, which has a great affect on memory usage especially if security options are enabled.
compare init scripts loading in files into cache that are subsequently unneeded later during boot
compare compile optimizations and configuration flags, usually -O3 uses more text RAM and -Os less. It will not affect runtime/stack/heap usage where glibc/kernel/software versions could.
compare how much ram you have (more memory you have, more page table memory needed)
compare drivers/hardware used (using a Trident card will use less memory than an nVidia).
I don't even care anymore on PCs until I actually run out of RAM, and inter-distribution comparisons are virtually worthless. Most of the time the memory is used to improve my experience (things like udisks/elogind/polkit and automount...saves me a manual step of manually mounting) and that's worth the RAM especially if it's not being used -- again unused ram is wasted ram. _________________ Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching? |
|
Back to top |
|
|
pietinger Moderator
Joined: 17 Oct 2006 Posts: 4985 Location: Bavaria
|
|
Back to top |
|
|
|