Skip to content

Commit

Permalink
Add systemd service unit to allow overcommitting memory on desktops
Browse files Browse the repository at this point in the history
Currently, a lot of users report that programs are crashing or hanging
on their desktops. The reason is that newer Firefox and browsers in
general need a lot of virtual memory for security reasons. Therefore,
despite enough memory being available, it requests even more.

Allowing to overcommit memory should fix this.

After long discussion in the group, it was decided to allow to
overcommit memory on desktop machines.

Install it into the graphical target as it’s not needed beforehand.

As overcommitting memory is enabled by default, maybe it should be
reversed, but it currently doesn’t matter.
  • Loading branch information
pmenzel committed May 15, 2018
1 parent e3496c9 commit bbb602e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ mkdir -p "$DESTDIR$udev_helperdir"

install_exec make-automaps/make-automaps "$DESTDIR$usr_sbindir/make-automaps"
install_data misc_systemd_units/automount.service "$DESTDIR$systemdunitdir/automount.service"
install_data misc_systemd_units/enable_overcommit_memory.service "$DESTDIR$systemdunitdir/enable_overcommit_memory.service"
install_data misc_systemd_units/gdm.service "$DESTDIR$systemdunitdir/gdm.service"
install_data misc_systemd_units/lazy-umount-nfs.service "$DESTDIR$systemdunitdir/lazy-umount-nfs.service"
install_exec mkmotd/mkmotd.pl "$DESTDIR$usr_sbindir/mkmotd.pl"
Expand Down
13 changes: 13 additions & 0 deletions misc_systemd_units/enable_overcommit_memory.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Wants=startup-tags.service
After=startup-tags.service
ConditionPathExists=/node/tags/desktop

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/sysctl vm.overcommit_memory=0
ExecStop=/usr/sbin/sysctl vm.overcommit_memory=2

[Install]
WantedBy=graphical.target

0 comments on commit bbb602e

Please sign in to comment.