Skip to content

--memory should error on amounts that cause the VM for a container to not boot #1202

Closed

Description

@Peyton-Spencer

I have done the following

  • I have searched the existing issues
  • 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 immediately
echo "test" | container run -i --rm --entrypoint /bin/echo docker.io/debian:bookworm-slim "hello"
# Output: hello

# Hangs indefinitely — any --memory value, even small ones
echo "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.

Environment

- OS: macOS 26.3 (25D125)
- Xcode: N/A
- Container: container CLI version 0.9.0 (build: release, commit: 3e49dce)
- Arch: arm64 (Apple Silicon)

Relevant log output

# No log output — the container simply never starts.
# container system status reports healthy before and during the hang.

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

  1. dcantah commented on Feb 13, 2026

    @dcantah
    Contributor

    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).

  2. dcantah commented on Feb 13, 2026

    @dcantah
    Contributor

    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.

  3. self-assigned this
    on Feb 13, 2026
  4. jglogan commented on Feb 13, 2026

    @jglogan
    Contributor

    I assume what's happening is our parser treats no suffix provided (1024m, 1024g, etc.) as bytes

    This. We can read this issue as "enforce some sane minimums".

  5. 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
  6. Peyton-Spencer commented on Feb 15, 2026

    @Peyton-Spencer
    Author

    This was helpful! I'm now using --memory 4G
    Feel free to close this

  7. added a commit that references this issue on Feb 18, 2026
    dfac83d
  8. added a commit that references this issue on Feb 18, 2026
    61c0378
  9. added a commit that references this issue on Aug 28, 2026
    0714a0d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions