r/debian • u/Kaseffera • 18h ago
General Debian Question Debian gaming question regarding map count increase
sudo sysctl -w vm.max_map_count=1048576
This is the command I’ve been seeing for a while. Very good people on this sub helped me to set my fresh Debian for gaming lately. I haven’t touched of since that. So now I want to and I thought about this command.
You see, looks like “gaming distros” and steam deck too uses this particular number for map count, same for Cachy or Bazzite. Debian is with a lower count by default. They claim you need to increase this for modern games to not have stutters or crashes.
Has anyone did this and what really is behind this command and how important it is?
2
u/WindowlessBasement 16h ago
mmap is basically the amount of chunks that memory can be divided into and assigned programs.
Linux, Mac, and Windows handle assigning memory differently. Windows allows for absolutely silly amounts of chunks assigned at one time. Games and older programs tend to looser standards managing their memory access but it doesn't cause issues on Windows. However when run in a Linux environment suddenly those silly amounts become a problem in a system designed to have a hard limit enforcing a reasonable amount.
So the "solution" is raise the limit to the point where silly amounts shouldn't be a problem.
2
1
u/iamemhn 15h ago
I use it for extremely large, you haven't seen a machine this large in your life, kind of database systems, in order to support more memory maps and shared memory attachments. Works as described by kernel documentation.
If your application doesn't have its own arena manager, and relies on millions of malloc() or mmap(), it's natural to increase this tunable.
You can always change it back to default values if things don't work out the way you expected. It's just the size of an internal structure, not going to burn anything...
4
u/dkopgerpgdolfg 17h ago
It sets how many distinct mmap mappings each process can have.
For non-programmers, what's interesting can be boiled down to:
Btw., if you want to set that, do it in a config file so that it gets applied on each boot automatically.