You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--memory should error on amounts that cause the VM for a container to not boot #1202
If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Run any container with the --memory flag. The container hangs indefinitely and never produces output. Without the flag, it works instantly.
# Works fine — prints output and exits immediatelyecho"test"| container run -i --rm --entrypoint /bin/echo docker.io/debian:bookworm-slim "hello"# Output: hello# Hangs indefinitely — any --memory value, even small onesecho"test"| container run -i --rm --memory 512 --entrypoint /bin/echo docker.io/debian:bookworm-slim "hello"# (hangs forever, no output, no error)
Tested systematically with timeout and system cycling between each run:
Test
--memory
Output
Exit
A
none
NO-MEMORY
0 (success)
B
--memory 1024
(empty)
124 (timeout after 20s)
C
none (control)
NO-MEMORY-CONTROL
0 (success)
Each test was preceded by a full container system stop / container system start cycle and pkill -9 of any stale processes to ensure clean state.
The bug is 100% reproducible with any --memory value (tested 512, 1024, 2048, 4096). Without the flag, containers work perfectly every time.
Impact: The hung container also leaves stale state that prevents subsequent containers from starting until the system is cycled.
Current behavior
container run --memory <any-value> hangs indefinitely. The process stays alive but the container never initializes — no output on stdout or stderr.
Expected behavior
The container should start with the specified memory limit and produce output normally.
I assume what's happening is our parser treats no suffix provided (1024m, 1024g, etc.) as bytes, and the virtual machine cannot boot with 1k/4k/etc. of memory (we round up to 1 MiB as it's a requirement for macOS, but still there's no way it's booting).
Something to note is our --memory works almost the complete opposite to usual container tools like docker/podman. In those tools your containers are given access to all the memory on the machine, and --memory is used as a constraint. For us we give you a default memory amount (today 1 GiB) and --memory is used to increase or (not as common but) decrease that amount. It'd be worth on our end figuring out what is around the lowest RAM amount we can go and still have the guest bootable, and possibly print a warning or just refuse to allow the run to go through if it's below some threshold.
changed the title [-][Bug]: `--memory` flag causes `container run` to hang indefinitely on v0.9.0[/-][+]`--memory` should error on amounts that cause the VM for a container to not boot[/+]on Feb 13, 2026
Activity
dcantah commentedon Feb 13, 2026
I assume what's happening is our parser treats no suffix provided (1024m, 1024g, etc.) as bytes, and the virtual machine cannot boot with 1k/4k/etc. of memory (we round up to 1 MiB as it's a requirement for macOS, but still there's no way it's booting).
dcantah commentedon Feb 13, 2026
Something to note is our
--memoryworks almost the complete opposite to usual container tools like docker/podman. In those tools your containers are given access to all the memory on the machine, and--memoryis used as a constraint. For us we give you a default memory amount (today 1 GiB) and--memoryis used to increase or (not as common but) decrease that amount. It'd be worth on our end figuring out what is around the lowest RAM amount we can go and still have the guest bootable, and possibly print a warning or just refuse to allow therunto go through if it's below some threshold.jglogan commentedon Feb 13, 2026
This. We can read this issue as "enforce some sane minimums".
[-][Bug]: `--memory` flag causes `container run` to hang indefinitely on v0.9.0[/-][+]`--memory` should error on amounts that cause the VM for a container to not boot[/+]fix: resolve container OOM hangs from tsgo and --memory flag
Peyton-Spencer commentedon Feb 15, 2026
This was helpful! I'm now using
--memory 4GFeel free to close this
fix: resolve container OOM hangs from tsgo and --memory flag (#55)
ContainerService: Add minimum memory amount validation (#1208)
Squashed commit of the following:
ContainerService: Add minimum memory amount validation (apple#1208)