Boosting the vm.max_map_count in Ubuntu

Apparently, the SteamOS already has a larger vm.max_map_count by default. Can we do the same on upcoming version of Ubuntu.

https://github.com/ValveSoftware/Proton/issues/6510#issuecomment-1422699309

Seems to help with some games’ stability (e.g. Hogwarts Legacy).

6 Likes

Hi, many users, including myself, have observed improved game stability by increasing the vm.max_map_count kernel parameter. Games like Counter-Strike 2, Hogwarts Legacy, DayZ, Payday 2, and Star Citizen greatly benefit from a higher vm.max_map_count , experiencing no more crashes and better performance.

SteamOS and Fedora has already adopted a higher default value for this parameter, leading to a noticeably smoother gaming experience. Implementing a similar adjustment in the next Ubuntu release could provide a substantial boost to the gaming community, making Ubuntu an even more attractive platform for gamers.

Thank you for considering this enhancement. Your efforts to improve the gaming ecosystem on Linux are greatly appreciated.

Regards,

Vincent.

4 Likes

may be related to next Ubuntu cycle, but fs.inotify.max_user_instances is leaking due some PowerShell extemporare and increasing it temporarily fixed it for a few years… silly

I’m surprised /proc/sys/vm/max_map_count defaults to 65530, or that there’s a limit at all. It makes sense some apps would crash.

Is it too late to fix this in 24.04?

1 Like

It should may be fixed in vanilla kernel, but /proc was deprecated 20 years ago…

mv /proc/* /sys/deprecated/
:underage: ctrl+F or ctrl+H and replace all occurences in kernel and force update all progs similar way :drum: and let kernel devs work on this :slight_smile:

According to Brodie Robertson on YouT, Canonical will have this update in 24. I have not independently confirmed this.

I found this in a Stack forum and it worked for me on Ubuntu Server 22.04.4 LTS; Kernel 6.5.0-27-lowlatency

# sudo sysctl -w vm.max_map_count=262144

Then for the persistence configuration. Must be LOGGED IN as root.  Using sudo for this command while logged in as <user> will be denied.

# sudo su

# echo "vm.max_map_count=262144" >> /etc/sysctl.conf

Then reboot with your favorite method.

To check if changed...

# cat /proc/sys/vm/max_map_count

Hope this helps.