We measured this on Ayakaleaf Pro 6.3.1 with the Toolkit, in a 2 vCPU / 2 GiB QEMU/KVM virtual machine running Ubuntu 24.04, with sandboxed compiles (
texlive-basic:2025.1) and Git integration on.Why 2 GB is not enough by default
Idle, with the default settings, Ayakaleaf Pro needs about 1.9 GiB. Ubuntu and Docker already use 364 MiB of a 2 GiB machine, which leaves about 1600 MiB.1. Add 2 GB of swap
This is the step that matters most.2. Lower memory use
Add these lines toconfig/variables.env. The Git integration container reads this file too.
variables.env
mongo entry under services in config/docker-compose.override.yml (the same file that sets the Ayakaleaf Pro image):
docker-compose.override.yml
bin/up -d.
With a 160 MiB heap, cloning or pushing a large project over Git may run out of memory, and the Git integration container restarts. We did not test this. If it happens, raise
-Xmx.
Results
Each test compiled a 33-page LuaLaTeX document withfontspec and 30 TikZ figures; concurrent compiles were different projects.
Without swap, one out-of-memory kill leads to the next:
web restarts, its start needs memory again, and the server hangs until a hard reset. With swap, three compiles at once take about as long as one, because what goes to swap are idle Node.js pages.
Not tested: Git clone and push load, many users editing at the same time, and swap on slow disks (our host used an SSD).
Kubernetes
Our Kubernetes guide turns swap off on the nodes (Prepare the nodes), so only step 2 applies there. PutNODE_OPTIONS and MALLOC_ARENA_MAX in the overleaf-env ConfigMap (Personalizing your instance). The MongoDB cache is already set in Deploy MongoDB and Redis.
