arXiv:2609.40082cs.OSSep 2026

Manuscript Offprint

arXiv:2609.40082

Tide: Reclaiming Phased Memory in Agent MicroVMs

Yiyang Wu, Chengfan Liao, Jinyu Gu

Open access. PaperVantage converted this article to text, so layout and figures may differ from the original.

Abstract

Cloud agents run each task in an isolated MicroVM. The trouble is the harness loop inside that guest: the harness is nearly idle while it waits on the model, then usage rises on a tool whose size is known only at run time, which complicates the memory management from the host. Existing approaches infer reclaim targets from access frequency and memory footprint while the guest allocator places the idle harness and the short-lived tool on the same pages. Therefore, reclamation either selects the wrong pages, fixes on an incorrect capacity or partially reclaims a huge page, splitting its transparent huge page (THP).

This paper proposes Tide, a proactive memory reclamation technique for agent MicroVMs. Our key insight is that the harness already knows each phase's memory intent—which memory, when, and whether its contents must survive—so the guest can report that intent as an exclusive guest-physical region for the host to reclaim directly. To realize this insight, we introduce (1) an abstraction called arena and a set of user-space API that can manage memory with an exclusive intent. (2) a guest-kernel allocator that places the realize the allocation that groups exclusive, huge-page-aligned extents; and (3) a hypervisor extension that resolves those extents to host backing and applies the reported action, leaving guest capacity unchanged. Experiments on recorded agent trajectories show that Tide outperforms state-of-art mechanism while incurring low overhead.

1 Introduction

Agents are moving into the cloud. Applications such as Claude Code [4], OpenCode [24], Codex [22], and OpenClaw [23] translate natural-language goals into sequences of model interactions and tool executions, and platforms now run each task inside an isolated MicroVM [1, 12]. The guest hosts the harness—the runtime that assembles context, calls the model, and executes tools—together with the processes those tools spawn, while model inference stays in a separate service. A host serves many tenants, so each agent gets its own guest kernel, and the cost of that isolation is physical memory held for the life of the task.

Four properties of memory properties matter for hosting agentic MicroVMs. First, demand follows the phase of the loop. The guest is nearly idle while the harness waits on the model, and usage rises when a tool runs locally. Second, the model chooses the next tool only at run time, so the size of each resource burst is hard to predict. Third, harness pages and tool pages share one guest and follow different lifetimes. Harness state stays live for the whole run, while a tool's private pages last only until its process tree exits. Lastly, host backing follows the peaks and stays after guest usage has fallen, including memory that can already be reclaimed.

However, existing memory management techniques still miss these properties on different dimensions. Host swapping ranks pages by access frequency, so it cannot separate idle-but-live harness pages from already-freed tool pages and may write those freed pages out in unnecessary I/O. Virtio-balloon [26] and virtio-mem [10] reclaim by shrinking guest capacity to a target, but a target sized for the wait may not fit the next burst causing severe direct guest reclaim. On top of that, the guest allocator places independent lifetimes in the same host huge pages, which causes reclaiming one lifetime splits huge-page mappings the other still uses.

The root cause is that the harness already knows each phase's memory intent from its control flow but the harness has no capability to report it. An intent names a scope, a trigger, and a preservation rule. During a long model wait, the scope is the harness and its persistent services, the trigger is the wait, and the rule is to page out state that is idle but live. When a tool's process tree exits, the scope is that invocation, the trigger is the exit, and the rule is to discard its private state sooner, however much memory the tool used. Two gaps keep that intent from driving reclamation. On the guest side, every phase allocates from the same buddy allocator, so pages of different intents are not distinguishable as regions and share host huge pages. On the host side, memory intent can only be inferred from access frequency and memory footprint and the guest has no way to report the intent across the guest-host boundary.

We present Tide, which closes both gaps with one abstraction, the arena. Its user-space API places each memory intent in its own guest-physical region, and operating on one arena leaves the others untouched. Harness state, including persistent services, lives in a dedicated arena H, and each tool invocation lives in its own arena T. Huge-page-aligned extents from a shared CMA pool give each arena exclusive host huge pages. User-space operations then can tell the host how to reclaim that region's backing without shrinking guest capacity. Since the harness itself cannot issue arena operations during a model wait or tool invocation, we design Anchor, a user-space component that stays outside H and T, delegates model requests and tool execution, and issues arena operations at each phase boundary. The guest reports the opera-tion and the arena’s guest-physical ranges to the hypervisor over a virtio channel. The hypervisor resolves those ranges to host backing through its own translation tables and applies the corresponding memory action while the host kernel stays unmodified.

We implement Tide in Linux, Firecracker, and OpenCode, OpenClaude, and Codex, with Anchor written in Rust. On the longer SkillsBench tasks, Tide stays within 1.7% of the baseline. On six Terminal-Bench tasks [19] running on OpenCode, OpenClaude, and Codex, Tide reduces total backing memory by 45.3%, 41.0%, and 34.2% relative to baseline and by 46.8%, 39.3%, and 32.9% relative to HyperAlloc, with harness-time increases of 5.1%, 1.1%, and 1.9%.

References (42)