Systemd >=240 sets a clamp of 64MB for RLIMIT_MEMLOCK, too low for some applications.

Bug #1840435 reported by Kain on 2019-08-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)

Bug Description

Systemd >= 240 sets a clamp for RLIMIT_MEMLOCK, which is too low for some realistic applications. This clamp should probably be increased. This breaks a number of current jackd setups, for example.

See upstream bug:

This occurs on at Ubuntu Disco and newer, Disco being the first release to ship with systemd >= 240.

Dan Streetman (ddstreet) wrote :

> This breaks a number of current jackd setups, for example.

please provide steps to reproduce the problem.

Changed in systemd (Ubuntu):
status: New → Incomplete
Kain (kain-kain) wrote :

Upon further inspection, this is actually fixed in systemd 241. To reproduce, try setting a LimitMEMLOCK higher than 64mb for the system unit user@.service, OR for any unit executed by a systemd --user process. You will see that the RLIMIT_MEMLOCK is actually clamped to 64MB. This can be observed by using prlimit -p <<any-process-id-inside-or-spawned-by-such-a-unit>>.

You can reproduce by trying to give a user session (via user@.service OR /etc/systemd/user.conf) a LimitMEMLOCK of greater than 64MB and then inside a systemd unit or inside a gnome-terminal (since gnome terminals in at least disco and newer are run under a systemd user-service) try to execute `jackd -d hw:0 -r 48000 -p 256 -n 3 -S`. You may need to suspend/stop pulseadio.

On my system at least (USB audio only), jackd wants to memlock 82280346 bytes (82MBish) of RAM for audio buffers and the like.

Balint Reczey (rbalint) wrote :

Marking as fixed in Eoan, since it already has systemd v242.

Changed in systemd (Ubuntu):
status: Incomplete → Fix Released
Kain (kain-kain) wrote :

Fix attached. Works on disco.

Steve Langasek (vorlon) on 2020-07-02
Changed in systemd (Ubuntu Disco):
status: New → Won't Fix
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.