mirror of
https://github.com/games-on-whales/LXC2Docker.git
synced 2026-10-15 12:52:04 +00:00
[PR #64] [MERGED] feat(pve): configurable default container memory (replace hardcoded 4GB) #65
Labels
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
games-on-whales/LXC2Docker#65
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/games-on-whales/LXC2Docker/pull/64
Author: @JBailes
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @JBailes
Base:
main← Head:feat/configurable-default-memory📝 Commits (1)
24a8131feat(pve): configurable default container memory (replace hardcoded 4GB)📊 Changes
8 files changed (+142 additions, -7 deletions)
View changed files
📝
cmd/docker-lxc-daemon/main.go(+6 -0)📝
internal/api/containers.go(+10 -0)📝
internal/lxc/config.go(+13 -5)📝
internal/lxc/manager.go(+7 -1)➕
internal/lxc/memory.go(+60 -0)➕
internal/lxc/memory_test.go(+44 -0)📝
internal/lxc/pve_tarball.go(+1 -1)📝
readme.md(+1 -0)📄 Description
Problem
PVE CTs created without an explicit
--memorywere hardcoded tomemory: 4096inwritePVEConfig. Any memory-heavy workload that doesn't set a limit (e.g. Wolf's WolfSteam game CTs) gets silently OOM-killed by the cgroup at ~4 GB — observed as deterministic, renderer-independent, log-silent crashes at game world-load.Fix
Resolve a CT's memory by precedence:
docker --memory(HostConfig.Memory)dld.memorylabel (per-container, e.g.dld.memory=32G)--default-memorydaemon flagMemory=0semanticsProxmox requires a concrete number, so we resolve one instead of leaving a low placeholder. The legacy (non-PVE) path is unchanged.
Changes
internal/lxc/memory.go(new):ParseMemorySize("16G"/"32768M"/bytes) +hostMemoryBytes(reads /proc/meminfo)internal/lxc/config.go:writePVEConfigresolves memory by the above precedenceinternal/lxc/manager.go:Manager.DefaultMemoryBytes, threaded to bothwritePVEConfigcall sitescmd/.../main.go:--default-memoryflaginternal/api/containers.go:dld.memorylabel🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.