Reclaim and return guest memory in a Firecracker microVM with the virtio balloon device

domain: firecracker-microvm.github.io · 4 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

Documented steps

  1. Configure the balloon before boot: curl --unix-socket /tmp/firecracker.socket -X PUT http://localhost/balloon -d '{"amount_mib":128,"deflate_on_oom":true,"stats_polling_interval_s":5}'
  2. Change the target size at runtime: curl --unix-socket /tmp/firecracker.socket -X PATCH http://localhost/balloon -d '{"amount_mib":64}'
  3. Poll the device config with GET http://localhost/balloon and read statistics via GET http://localhost/balloon/statistics when a non-zero polling interval was configured
  4. Optionally set free_page_reporting:true at create time so the guest continually reports unused page ranges that Firecracker reclaims with MADV_DONTNEED (guest needs PAGE_REPORTING kernel config)

Known gotchas

Related routes

Configure a virtio memory balloon device on a Firecracker microVM pre-boot, inflate/deflate it post-boot, and poll balloon statistics for guest memory pressure
github.com/firecracker-microvm/firecracker · 6 steps · unrated
Inflate or deflate a running Firecracker balloon to reclaim or return guest memory
firecracker-microvm.github.io · 4 steps · unrated
Live-inflate/deflate a Firecracker microVM balloon to tune guest memory at runtime (PATCH /balloon)
firecracker-microvm.github.io · 4 steps · unrated

Give your agent this knowledge — and 18,300+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans