From 3abe5e83a708f44f8ff0ecc5f13e8730ca479f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torjus=20H=C3=A5kestad?= Date: Sun, 8 Feb 2026 13:29:42 +0100 Subject: [PATCH] docs: add memory ballooning as fallback option Co-Authored-By: Claude Opus 4.5 --- docs/plans/memory-issues-follow-up.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/docs/plans/memory-issues-follow-up.md b/docs/plans/memory-issues-follow-up.md index 4173063..d1899ac 100644 --- a/docs/plans/memory-issues-follow-up.md +++ b/docs/plans/memory-issues-follow-up.md @@ -90,5 +90,27 @@ After a few days (allow auto-upgrades to run on all hosts): If zram is insufficient: 1. **Increase VM memory** - Update `terraform/vms.tf` to 4GB for affected hosts -2. **Use remote builds** - Configure `nix.buildMachines` to offload evaluation -3. **Reduce flake size** - Split configurations to reduce evaluation memory +2. **Enable memory ballooning** - Configure VMs with dynamic memory allocation (see below) +3. **Use remote builds** - Configure `nix.buildMachines` to offload evaluation +4. **Reduce flake size** - Split configurations to reduce evaluation memory + +### Memory Ballooning + +Proxmox supports memory ballooning, which allows VMs to dynamically grow/shrink memory allocation based on demand. The balloon driver inside the guest communicates with the hypervisor to release or reclaim memory pages. + +Configuration in `terraform/vms.tf`: +```hcl +memory = 4096 # maximum memory +balloon = 2048 # minimum memory (shrinks to this when idle) +``` + +Pros: +- VMs get memory on-demand without reboots +- Better host memory utilization +- Solves upgrade OOM without permanently allocating 4GB + +Cons: +- Requires QEMU guest agent running in guest +- Guest can experience memory pressure if host is overcommitted + +Ballooning and zram are complementary - ballooning provides headroom from the host, zram provides overflow within the guest.