Skip to content

Reduce default --memory to 32Mi, set examples to measured minimums#77

Merged
danbugs merged 2 commits into
mainfrom
reduce-default-memory
May 21, 2026
Merged

Reduce default --memory to 32Mi, set examples to measured minimums#77
danbugs merged 2 commits into
mainfrom
reduce-default-memory

Conversation

@danbugs
Copy link
Copy Markdown
Contributor

@danbugs danbugs commented May 21, 2026

Summary

  • Binary-searched the minimum --memory each example actually needs to produce correct output
  • Updated every example's Justfile to use its measured minimum
  • Changed CI to read memory from Justfiles instead of hardcoding values in the workflow matrix
  • Lowered the CLI default from 512Mi to 32Mi — covers all lightweight examples (C, Rust, Go, .NET, shell) with headroom; heavy runtimes (Python, Node, PowerShell) require explicit --memory
  • Fixed two under-provisioned examples: hostfs-posix-py (was 96Mi, needs 512Mi) and python-tools (was 96Mi, needs 512Mi)

Measured minimums

Example Minimum Previous
helloworld-c 2Mi 4Mi
hostfs-posix-c 2Mi 16Mi
dotnet-nativeaot 8Mi 16Mi
rust, go, shell, dotnet 16Mi 16Mi
networking-py 32Mi 512Mi
hostfs-posix-py, python, python-tools, nodejs 512Mi 96Mi-512Mi
powershell, python-agent 1Gi 1Gi

every example already specifies its own --memory value in its Justfile,
so nothing depends on the CLI default. 64Mi comfortably covers the
lightweight examples (helloworld-c needs 4Mi, rust/go/dotnet/shell need
16Mi) while heavier workloads (python 512Mi, powershell 1Gi) continue
to set their own.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
Copilot AI review requested due to automatic review settings May 21, 2026 21:51
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Lowers the hyperlight-unikraft CLI’s default guest memory/heap size from 512Mi to 64Mi, aligning the out-of-the-box default with the lightweight examples while still allowing heavier workloads to override via --memory.

Changes:

  • Change --memory default from 512Mi to 64Mi.
  • Update the CLI help text examples to include 64Mi.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Linux Benchmarks

Details
Benchmark suite Current: bb82d7d Previous: d8524a9 Ratio
hello_world (median) 20 ms 20 ms 1
pandas (median) 100 ms 110 ms 0.91
density (per VM) 7 MB 7 MB 1
snapshot (disk) 385 MiB 385 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Windows Benchmarks

Details
Benchmark suite Current: bb82d7d Previous: d8524a9 Ratio
hello_world (median) 269 ms 179 ms 1.50
pandas (median) 779 ms 508 ms 1.53
density (per VM) 6 MB 6 MB 1
snapshot (disk) 392 MiB 392 MiB 1

This comment was automatically generated by workflow using github-action-benchmark.

binary-searched the minimum --memory each example needs to produce its
expected output:

  helloworld-c: 2Mi    rust: 16Mi         go: 16Mi
  shell: 16Mi          dotnet: 16Mi       dotnet-nativeaot: 8Mi
  hostfs-posix-c: 2Mi  hostfs-posix-py: 512Mi  python: 512Mi
  python-tools: 512Mi  nodejs: 512Mi      powershell: 1Gi
  networking-py: 32Mi  python-agent: 1Gi

update each example's Justfile to use its measured minimum, and have CI
read the memory value from the Justfile instead of hardcoding it in the
workflow matrix. this makes the Justfile the single source of truth.

also fixes two under-provisioned examples that were silently relying on
headroom: hostfs-posix-py (was 96Mi, needs 512Mi) and python-tools
(was 96Mi, needs 512Mi).

lower the CLI default from 512Mi to 32Mi — covers every lightweight
example with headroom while giving an honest signal that heavy runtimes
(python, nodejs, powershell) need explicit --memory.

Signed-off-by: danbugs <danilochiarlone@gmail.com>
@danbugs danbugs changed the title Reduce default memory from 512Mi to 64Mi Reduce default --memory to 32Mi, set examples to measured minimums May 21, 2026
@danbugs danbugs merged commit 20ccc2d into main May 21, 2026
79 checks passed
@danbugs danbugs deleted the reduce-default-memory branch May 21, 2026 22:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants