Linux: Wine's server tmpmaps live in /tmp (tmpfs) and consume RAM; bind-mount them to disk #419

Closed
opened 2026-11-28 21:53:17 +00:00 by JoshRob297 · 0 comments
JoshRob297 commented 2026-11-28 21:53:17 +00:00 (Migrated from github.com)
Contributor

Imported from brcly/TuxBox. Originally posted by JoshRob297 on 2026-11-28T21:53:17Z.


Summary

On Linux, Wine's server directory lives in /tmp (/tmp/.wine-$UID/server-*), and on most distributions /tmp is tmpfs, so every tmpmap-* file the title maps is RAM. A GTA VI port using Wine 11.22 on a 30 GB machine mapped 20,217 tmpmap files (~22 GB) during the front-end load; with /tmp at its 16 GB tmpfs size the allocation fails and the process dies (exit 5, or an oom-kill from systemd-oomd).

This is not the runtime's arena and not the title's own allocations: free shows the growth under shared, /tmp fills up, and the process dies under pressure. It reads as a null write in some runs because the title's watchdog fires after the stall.

Measurement (Intel Meteor Lake iGPU, Mesa ANV 26.2.6, Wine 11.22, 30 GB RAM)

Before:

$ df -h /tmp
tmpfs  16G  14G  2G  88% /tmp
$ grep -c tmpmap /proc/<pid>/maps
20217
$ du -sh /tmp/.wine-1000

The tmpmaps are deleted-but-open files, so du reports 0 while the pages stay in RAM.

After binding that directory to a disk-backed path:

$ sudo mkdir -p /home/$USER/wine-server
$ sudo chmod 700 /home/$USER/wine-server
$ sudo mount --bind /home/$USER/wine-server /tmp/.wine-1000
$ df -h /tmp
tmpfs  16G  30M  16G  1% /tmp

Free RAM went from ~2 GB to ~26 GB, and the same run reached the front-end instead of dying.

Notes

  • wineserver hardcodes /tmp/.wine-%u; it ignores TMPDIR/XDG_RUNTIME_DIR, and it rejects a symlink with wineserver: /tmp/.wine-1000 is not a directory. The bind mount is the only fix without changing Wine.
  • The directory must be mode 0700: wineserver: /tmp/.wine-1000 must not be accessible by other users.
  • To persist across reboots, add to /etc/fstab:
    /home/<user>/wine-server /tmp/.wine-1000 none bind 0 0
  • This affects any Wine/Proton-based port of this title, not just TuxBox. Upstream Wine could honour TMPDIR or XDG_RUNTIME_DIR for the server directory; worth a bug report there too.

Might be worth a line in the Linux/Proton docs, since it shows up as memory pressure and as a GPU-adjacent crash rather than as a temp-directory problem.

<!-- greyfinch-sync:brcly/TuxBox:issue:6671580276 --> Imported from [brcly/TuxBox](https://github.com/brcly/TuxBox/issues/419). Originally posted by [JoshRob297](https://github.com/JoshRob297) on 2026-11-28T21:53:17Z. --- ## Summary On Linux, Wine's server directory lives in `/tmp` (`/tmp/.wine-$UID/server-*`), and on most distributions `/tmp` is tmpfs, so every `tmpmap-*` file the title maps is RAM. A GTA VI port using Wine 11.22 on a 30 GB machine mapped **20,217 tmpmap files (~22 GB)** during the front-end load; with `/tmp` at its 16 GB tmpfs size the allocation fails and the process dies (exit 5, or an oom-kill from systemd-oomd). This is not the runtime's arena and not the title's own allocations: `free` shows the growth under **shared**, `/tmp` fills up, and the process dies under pressure. It reads as a null write in some runs because the title's watchdog fires after the stall. ## Measurement (Intel Meteor Lake iGPU, Mesa ANV 26.2.6, Wine 11.22, 30 GB RAM) Before: ``` $ df -h /tmp tmpfs 16G 14G 2G 88% /tmp $ grep -c tmpmap /proc/<pid>/maps 20217 $ du -sh /tmp/.wine-1000 ``` The tmpmaps are deleted-but-open files, so `du` reports 0 while the pages stay in RAM. After binding that directory to a disk-backed path: ``` $ sudo mkdir -p /home/$USER/wine-server $ sudo chmod 700 /home/$USER/wine-server $ sudo mount --bind /home/$USER/wine-server /tmp/.wine-1000 $ df -h /tmp tmpfs 16G 30M 16G 1% /tmp ``` Free RAM went from ~2 GB to ~26 GB, and the same run reached the front-end instead of dying. ## Notes - wineserver hardcodes `/tmp/.wine-%u`; it ignores `TMPDIR`/`XDG_RUNTIME_DIR`, and it rejects a symlink with `wineserver: /tmp/.wine-1000 is not a directory`. The bind mount is the only fix without changing Wine. - The directory must be mode `0700`: `wineserver: /tmp/.wine-1000 must not be accessible by other users`. - To persist across reboots, add to `/etc/fstab`: `/home/<user>/wine-server /tmp/.wine-1000 none bind 0 0` - This affects any Wine/Proton-based port of this title, not just TuxBox. Upstream Wine could honour `TMPDIR` or `XDG_RUNTIME_DIR` for the server directory; worth a bug report there too. Might be worth a line in the Linux/Proton docs, since it shows up as memory pressure and as a GPU-adjacent crash rather than as a temp-directory problem.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
brcly/TuxBox#419
No description provided.