WorksComputer Science
TenonAgent: Virtualizing Execution Residency for Memory-Oversubscribed LLM Agents
Abstract
LLM agents execute as long-lived, multi-stage workflows with substantial resource-demand variation across phases. Provisioning each agent or sandbox for its lifetime peak leads to low resource utilization, particularly for memory, whereas aggressive oversubscription risks memory contention, out-of-memory failures, and costly workflow retries. This tension limits the concurrency and efficiency of agent serving under constrained host memory. We present TenonAgent, a runtime system that virtualizes sandbox residency by decoupling the logical agent's lifetime from its physical execution environment. To manage memory oversubscription, TenonAgent employs a dual-timescale control plane. At action boundaries, it combines predictive admission control with a fail-closed, restart-safe contract, dynamically materializing or dematerializing sandboxes based on global memory pressure. During active tool execution, a sched_ext-based kernel gate paces sandbox execution permissions to reduce unexpected concurrent memory growth. The gate provides feedback control over future execution opportunities. Evaluations across diverse agentic workloads show that, under the tested workloads and parameter settings, TenonAgent substantially reduces observed OOM failures and achieves a 100% task success rate in bursts reaching an 8.6x memory oversubscription ratio. Overall, it delivers up to a 5.5x speedup over unmanaged execution, outperforms existing agent-level and cgroup-based schedulers by 5x to 37x, and provides consistent benefits across both Docker and Firecracker microVM backends.
Introduction
LLM agents are turning cloud AI from sequences of stateless inference requests into long-lived, stateful computations that interleave model reasoning with tool invocation and local execution [19, 42, 43]. A single task may alternate among remote model calls, shell commands, code execution, browser interactions, retrieval, and package installation while carrying state across many steps [28, 33, 37, 47, 48, 49, 50, 51, 56].
Agent-serving systems commonly separate orchestration from tool execution. An external controller maintains the conversation, execution trajectory, and action metadata [22, 23], while an isolated container or microVM [2, 4, 7, 17] executes local commands, tools, and generated code. The sandbox provides an isolation and resource-accounting boundary and is commonly retained across actions, allowing later actions to reuse its files, processes, runtime state, and cached data. Figure 1 illustrates this execution model for representative software-engineering and scientific data-analysis agents.

Figure 1. Representative agent workflows. Both software-engineering and scientific data-analysis agents execute as multi-step, stateful workflows.
When many agents share a host, their long-lived sandboxes compete for finite memory capacity. Provisioning each sandbox for its lifetime peak strands capacity during less demanding phases, whereas smaller static allocations risk allocation stalls, swapping, or out-of-memory (OOM) failures when several sandboxes grow concurrently [5, 16, 20, 41, 45, 46]. Moreover, an agent may wait for a remote model or external service while its sandbox retains runtime state, cached data, and intermediate artifacts accumulated by preceding actions. Thus, low execution activity does not imply either a small resident footprint or readily reclaimable memory.
Our profiling (§ 2.2) reveals that agent memory demand and execution activity vary across semantically distinct actions. Waiting-dominated intervals exhibit little local CPU activity and limited memory growth, whereas tool invocation and code execution can produce bursts of CPU activity, I/O, and memory allocation. At the same time, a waiting sandbox may retain substantial memory allocated by earlier actions.
This behavior creates an opportunity for semantic resource control. Before an action executes, the runtime can infer upcoming demand from its type and causal trajectory; upon action completion, it can reconsider whether the sandbox must remain resident. Action boundaries thus expose natural opportunities to estimate incremental demand before admission and to regulate retained state afterward. Figure 2 contrasts this with existing control granularities. Whole-agent control treats the entire workflow as a single coarse scheduling unit [22, 23], while sandbox-lifetime control enforces isolation at the container or microVM level [2, 4, 7] without exposing intra-workflow transitions. In contrast, action-boundary control decouples logical agent orchestration from physical sandbox residency, enabling fine-grained memory adjustments while preserving sandbox isolation.

Figure 2. Resource-control granularity in agent runtimes. Whole-agent control makes resource decisions for an entire agent execution, while sandbox-lifetime control introduces isolation and accounting but does not reconsider resource decisions across actions. Phase-level control preserves the sandbox isolation boundary while using action-completion and action-ready events as finer-grained control points.
Managing memory across these boundaries poses unique challenges distinct from CPU. Unlike CPU, which can be time-shared or throttled, memory pressure stems from both inactive retained footprints and dynamic allocations during execution, and throttling cannot reclaim allocated space. Furthermore, while action completion offers a natural reclamation point, dematerializing a sandbox is not always safe: retaining it avoids reconstruction overhead but consumes memory headroom, whereas dematerializing releases memory only when subsequent execution state is durably preserved. An agent runtime must therefore coordinate action admission, execution growth, and residency, explicitly separating whether a sandbox can be safely dematerialized from whether current host pressure makes doing so beneficial.
To address this challenge, we present TenonAgent, which virtualizes sandbox residency by decoupling a logical agent’s lifetime from that of its execution sandbox. While the sandbox transitions between resident and absent states, an external controller preserves the agent trajectory and action metadata, and a persistent workspace retains durable execution state. The sandbox can thus be rematerialized without changing the agent’s logical identity.
TenonAgent combines action-boundary decisions with runtime feedback. At action completion, a fail-closed restart-safe contract determines whether the sandbox may be dematerialized, after which memory pressure determines whether it should be retained. At action readiness, TenonAgent predicts incremental demand from the action and its trajectory, rematerializes the sandbox if necessary, and admits execution according to available headroom.
During execution, a user-space controller monitors memory pressure and sandbox growth to correct prediction errors. It updates cgroup-level permissions enforced by a sched_ext gate, which delays selected sandbox tasks to limit further allocation opportunities. Although this mechanism cannot reclaim existing allocations or immediately block new ones, it forms a closed loop with action-boundary control: user space manages semantic policy, while the kernel enforces sandbox-wide execution decisions.
We implement TenonAgent for Docker containers and Firecracker microVMs and evaluate it on three LLM-agent workloads under constrained memory. We compare against eager Linux, static low- and high-concurrency configurations, an agent-level reservation scheduler [18], and AgentC-group [54]. We measure makespan, P50 workflow latency and peak memory, and OOM and timeout events; failed workflows are re-enqueued so that retry costs are included.
This paper makes the following contributions:
We introduce sandbox residency virtualization, which decouples an LLM agent’s logical lifetime from its physical execution sandbox. With restart-safe action boundaries, eligible idle sandboxes can be dematerialized and deterministically reconstructed without breaking logical identity or task progression.
We design a two-timescale host-memory control policy that combines pressure-aware residency management, predictive action admission, and runtime execution pacing. This reduces the impact of demand-prediction errors and varying host-memory contention without static per-sandbox reservations.
We implement TenonAgent for Docker and Firecracker and evaluate it on SWE-bench, ScienceAgentBench, and Orchard RL rollout. Under the tested workloads and parameter settings, TenonAgent substantially reduces observed OOM failures, achieves a 100% task success rate in bursts reaching an 8.6× memory oversubscription ratio, and delivers up to a 5.5× speedup over unmanaged execution.
Background and Motivation
Agent Workflows Management
Representative agent workflows (e.g., Figure 1) interleave model reasoning with environment actions. Outputs from each step can dynamically alter the environment through files, dependencies, or runtime processes. Consequently, an agent workflow operates as a long-lived, stateful program rather than a sequence of stateless model requests. Resource demand fluctuates substantially across these steps. For instance, waiting on external LLM calls incurs negligible local activity, whereas local tool executions can trigger sharp bursts in CPU, I/O, and memory allocations.
In production deployments, agents typically execute within isolated sandboxes (e.g., containers [30, 54] or microVMs [2, 11, 12]). Existing orchestration platforms, such as Kubernetes [8], manage resources by applying static limits at the container or pod level, enforced by Linux cgroups [39, 40]. Under this model, the execution sandbox and its resource allocations persist for the entire lifetime of the workflow, independent of the dynamic phase changes occurring inside the application.
Empirical Motivation
Experiment 1: Profiling Resource Dynamics. We profile representative SWE-agent [49] executions and collect user-space and OS-level signals, including CPU utilization, resident memory, page-fault activity, I/O activity, and memory pressure stall information (PSI). We align these measurements with semantic events in the execution trajectory, including model invocations, tool calls, local commands, and result validation. Figure 3 shows a representative execution trace together with its action annotations.

Figure 3. Resource dynamics of a representative SWE-agent execution, aligned with semantic events in its execution trajectory.
Observation 1: Semantic Phases Delineate Distinct Resource Regimes. The profiled traces reveal that resource demand fluctuates drastically, and these shifts align strictly with semantic transitions rather than physical time intervals. During the execution of an action, local computation produces sharp bursts in CPU activity, page faults, and memory allocation. However, once the action completes and the agent
enters a waiting phase (e.g., awaiting an LLM response), new allocations cease and CPU utilization drops to near zero. Despite this inactivity, the memory accumulated by preceding actions typically remains resident—for instance, plateauing at roughly 150 MB after a 469 MB burst in our representative trace. These distinct regimes suggest that semantic phase boundaries (e.g., action-completion and action-ready events) provide natural, workload-aware intervention points to reconsider resource allocation, offering a more precise control granularity than fixed time windows.
Experiment 2: Boundary-Policy Trade-offs under Concurrency. We compare memory-management policies applied at the same boundaries between action-execution phases. Retaining a sandbox preserves warm state and avoids reconstruction overhead, but continues to occupy memory. Teardown releases nearly all sandbox memory, but subsequent execution incurs materialization and re-warming costs. For each policy, we simultaneously launch either one workflow () or twenty workflows (). All policies use the same replayed trajectories and reconstruct semantically equivalent environments. We measure task completion time and aggregate residual memory after boundary processing. Aggregate memory captures the host-level footprint accumulated across concurrent workflows. Figure 4 shows the resulting memory–latency trade-offs.
Figure 4. Aggregate residual memory versus task completion time under different boundary policies. Open and filled markers denote and , respectively. Each line connects the two concurrency levels for the same benchmark and policy, rather than representing a continuous trade-off curve.
Observation 2: Concurrency Shifts the Memory–Latency Trade-off. The results demonstrate that no single boundary policy is optimal across all operating conditions. At low concurrency (), retention-oriented policies significantly reduce task completion time by avoiding the substantial overhead of sandbox reconstruction and environment re-warming, albeit at the cost of a larger residual memory footprint. However, as concurrency scales to , the retention policy causes retained memory to accumulate rapidly across all idle sandboxes. This aggregate footprint creates severe host-level memory contention, which inflates the completion time and entirely erases the low-concurrency latency advantage. Conversely, the teardown policy releases nearly all memory at action boundaries, maintaining a consistently small residual footprint. While teardown incurs a baseline rematerialization penalty, its completion time remains much less sensitive to increased concurrency. Consequently, boundary management must be adaptive: favoring retention when memory headroom is abundant, and shifting to proactive reclamation as aggregate memory pressure rises.
Implications. Together, these observations motivate semantic and load-adaptive memory management. Action boundaries provide practical decision points, but reclamation must account for restart safety and current system conditions. Moreover, boundary policies control memory retained between actions, not memory growth after execution begins. Effective oversubscription therefore requires jointly managing sandbox residency, action admission, and execution-time memory growth.
TenonAgent Design
Overview
TenonAgent is built around a separation between logical agent identity and physical sandbox residency. A logical agent is defined by the external controller state and durable workspace that persist across actions, whereas the sandbox is the physical execution substrate that holds ephemeral state such as processes, runtime caches, services, and live connections. By separating these two notions, TenonAgent can keep an idle sandbox warm when memory is available, or safely dematerialize it under memory pressure without changing the identity of the agent.
Figure 5 illustrates this architecture, which is governed by a dual-timescale control plane. At coarse-grained action boundaries, a user-space orchestrator leverages demand predictions to admit new execution phases, dynamically managing idle sandboxes based on global memory pressure. At the fine-grained execution timescale, a sched_ext-based kernel gate monitors instantaneous memory growth, pacing CPU permissions to throttle sandboxes that deviate from their admitted limits. Ultimately, TenonAgent couples proactive demand prediction to unlock high concurrency with reactive kernel enforcement to help maintain system safety under extreme oversubscription.
Figure 5. TenonAgent architecture for agent sandbox residency virtualization.
Global Memory-Pressure State
Unlike CPU time, memory remains occupied even when execution pauses. Memory control must therefore manage both memory retained by resident sandboxes and additional memory that active phases may allocate. Because reclaiming retained memory takes time, TenonAgent must respond before active execution exhausts the remaining headroom. It captures this global condition using three pressure states—GREEN, YELLOW, and RED—denoted by .
The user-space controller determines by monitoring the available memory of the workload-domain parent cgroup and estimating the remaining growth of already-admitted phases. GREEN indicates that sufficient headroom remains for both current occupancy and expected growth. YELLOW indicates that the system is still safe but its margin is narrowing, requiring preventive reclamation. RED indicates that little headroom remains or that active phases may consume the remaining capacity, requiring immediate restrictions on further memory growth. Accounting for predicted growth allows TenonAgent to react before current memory usage alone reveals critical pressure.
| Mechanism / Policy | GREEN | YELLOW | RED |
| Retain idle sandboxes | ✓ | ✗ | ✗ |
| Predictive rematerialization | ✓ | ✗ | ✗ |
| Admit new execution | ✓ | ✓ | ✗ |
| Unrestricted memory growth | ✓ | ∼ | ✗ |
Table 1. System policies in each pressure state (∼: selective throttling).
As summarized in Table 1, coordinates two complementary control paths. User-space sandbox lifecycle management (§3.4) reclaims retained memory from idle sandboxes, while kernel-enforced execution control (§3.5) limits further memory growth in active ones. The user-space controller determines the overall policy, and the kernel promptly enforces the resulting execution permissions.
Action Descriptors and Resource Prediction
Action descriptors. For each upcoming action , TenonAgent constructs a descriptor
where denotes the action class, and are its predicted average and peak cgroup footprints, captures heavy-memory risk, and represents scheduling priority or latency sensitivity. Together, these fields model the action’s expected resource demand and scheduling requirements, serving as inputs to admission and execution control.
Restart-safe recoverability. Separately, TenonAgent labels the boundary preceding as either restartable or resident_only. TenonAgent supports restart-safe recovery under a restricted action execution model rather than inferring restartability for arbitrary programs. TenonAgent does not instrument or rewrite the agent to make an arbitrary execution restartable; instead, it checks whether the boundary exposed by the existing agent execution satisfies this restricted restart-safe contract. A boundary is restartable
only when the completed action has externalized its logical state, left no required state exclusively in live processes or connections (e.g., persistent shells or background services), and persisted durable artifacts for deterministic reconstruction. Figure 6 shows the protocol when sandbox release is selected. The controller blocks new action dispatch throughout teardown preparation and determines eligibility through deterministic runtime checks, without LLM-based judgment. Teardown is permitted only after a validated recovery record has been committed, linking the logical agent state, filesystem artifact versions, and runtime configuration to the completed action boundary. This protocol is strictly fail-closed: any unsupported execution or preparation failure defaults the boundary to resident_only. As a correctness constraint, memory-pressure policies may still throttle a resident_only sandbox, but cannot tear it down. Upon rematerialization, restoration reconstructs the recorded environment and state; it neither replays the completed action nor restores arbitrary process memory. We detail these execution constraints and recovery procedures in Appendix.

Figure 6. Restart-safe teardown and restoration. Preparation failures retain the resident sandbox.
User-Space Boundary-Scale Scheduling
Causal resource prediction. Figure 7 shows the training and runtime prediction pipeline. Before action executes, TenonAgent constructs a causal feature vector from its action context, summaries of completed actions in the same task, and TF–IDF features derived from the prompt, current action, and recent trajectory. The predictor uses only information available before begins; it cannot access the action’s realized resource usage, outcome, failure state, or any future action.

Figure 7. Pipeline for constructing action-level resource predictors and generating causal predictions at runtime.
Separate models predict average memory, peak memory, and heavy-memory risk, allowing the scheduler to use different levels of conservatism for normal accounting, peak-aware admission, and high-risk actions. After completes, its measured average footprint, peak footprint, and heavy-memory label are appended to the task-local history and become available only to later predictions. Training samples are constructed by aligning resource profiles with extracted action phases, and task-level train/validation splits prevent leakage across correlated actions.
At semantic action boundaries, TenonAgent coordinates action admission and idle-sandbox residency. Admission uses action descriptors to maintain a logical memory water level based on the predicted charges of admitted actions, whereas residency control uses the global pressure state to retain or reclaim sandboxes during wait phases. This separation enables admission to anticipate near-term demand while residency control responds to system-wide pressure.
Water-level-aware action admission. TenonAgent handles actions with heterogeneous memory demands. Strict FIFO can cause head-of-line blocking when the oldest action does not fit, while always prioritizing small actions can starve memory-intensive ones. TenonAgent therefore combines water-level-aware memory accounting, logical and physical admission checks, and the light/heavy queues shown in Figure 8. The queues share a logical memory budget and differ only in scheduling priority.

Figure 8. Water-level-aware admission with light and heavy queues sharing one logical memory budget.
For each action , TenonAgent assigns a logical memory charge by interpolating between its predicted average and peak demands. The interpolation factor depends on , the total logical charge of currently admitted actions:
Here, is a configured capacity threshold (e.g., 6 GB), and clamps its argument to . Thus, the charge moves from the predicted average toward the predicted peak as the admitted logical footprint approaches . The charge is fixed at admission and released when the action completes, regardless of whether its sandbox remains resident. Among admissible actions, TenonAgent normally prioritizes the light queue to avoid leaving capacity unused while a heavy action waits. To prevent starvation, the oldest heavy action accrues protected logical credit at rate ; light actions cannot consume this credit. As running actions complete, the credit protects an increasing share of the logical budget for that heavy action. It affects scheduling priority only.
Wait-phase residency and rematerialization. Residency control begins when an action completes. A sandbox may be reclaimed during the wait phase only if the completed
| Algorithm 1 Runtime execution permission control |
| Require: Live sandboxes , time , available memory , demands , and retained controller state |
| Ensure: Permitted set and updated controller state |
| 1: ; |
| 2: Determine pressure from and , giving RED priority |
| 3: Update the Green stability timer |
| 4: if then |
| 5: |
| 6: else |
| 7: |
| 8: Order : overdue first (), then the prescribed tie-breaking rules |
| 9: if , otherwise ; |
| 10: for all in order do |
| 11: |
| 12: if and then |
| 13: ; ; |
| 14: end if |
| 15: end for |
| 16: end if |
| 17: Publish ALLOW for and DENY for |
| 18: Clear timers for allowed sandboxes; start unset denial timers at and retain existing ones |
| 19: Change denied Growing sandboxes to PausedGrowing |
| 20: ; |
Table 1 (PDF p. 6).
boundary is restartable; otherwise, it remains resident. Under GREEN, TenonAgent retains idle sandboxes by default and reclaims ones only when the predicted wait amortizes teardown and rematerialization. Under YELLOW or RED, it prioritizes memory recovery and reclaims restartable sandboxes in decreasing order of measured working set.
Rematerialization is triggered when the next action becomes ready. Under GREEN, TenonAgent may also perform lower-priority predictive rematerialization. Under YELLOW, speculative work is disabled, but demand-driven rematerialization may proceed if it passes the physical gate and obtains a lifecycle slot. Under RED, no new rematerialization starts; queued requests are reconsidered after pressure falls. Rematerialization restarts the execution service, restores the persistent workspace and controller metadata, checks readiness, and refreshes the sandbox’s cgroup identity.
Concretely, at , TenonAgent records the result, determines , releases action ’s admission charge, and applies the residency policy without requiring the next action’s descriptor. At , it rematerializes a non-resident sandbox according to the current pressure state. Reconstruction is included in physical accounting only while active, and the waiting action holds no admission charge. Once the sandbox is ready, the action competes for logical admission and passes the physical gate before execution; runtime permission is subsequently reevaluated at each control update.
Runtime Execution Control
TenonAgent controls memory pressure before it turns into an OOM event. The key observation is that the scarce resource during execution is often not a sandbox’s current footprint, but its near-future memory growth. A sandbox with a stable working set can usually keep running safely, while a smaller but aggressively allocating sandbox may quickly consume the remaining headroom. Thus, TenonAgent schedules positive memory growth as a runtime resource, analogous to how congestion control regulates sending rate rather than reacting only after a queue has filled.
Algorithm 1 summarizes the control loop. Each iteration estimates per-sandbox growth from cgroup-accounted memory samples, classifies global pressure as GREEN, YELLOW, or RED, and publishes the corresponding allow/deny decisions to the scheduler. In GREEN, all live sandboxes run. Under pressure, TenonAgent admits only a bounded number of growing sandboxes whose predicted growth fits the remaining headroom; in RED, this bound collapses to a single headroom-checked probe.
Growth-aware admission. The controller distinguishes sandboxes that are growing from those that appear resident or cooling. This distinction is used only for execution control: a sandbox with no predicted positive growth does not consume a growth slot, while a sandbox with positive predicted growth does, even if its current footprint is small. This design prevents the scheduler from being biased toward small but rapidly allocating sandboxes and instead prioritizes executions that are less likely to increase memory pressure.
Admission in Yellow follows a congestion-control rule. Rather than fixing a single conservative concurrency limit, TenonAgent uses additive increase and multiplicative decrease to adapt the number of concurrent growth contributors. When the system remains stable, the controller cautiously increases the growth budget; when pressure worsens, it cuts the budget back. This lets the system probe for available memory parallelism while reacting quickly to congestion, mirroring the way AIMD network controllers search for safe bandwidth.
Red-mode probing. When memory pressure reaches Red, TenonAgent stops treating concurrency as the goal. The objective becomes controlled progress without allowing a burst of new allocations. Red therefore permits at most one growing sandbox at a time, and only if its predicted growth fits in the current headroom. This sandbox acts as a probe: it may continue, be replaced, or be denied again at the next control iteration. The one-probe rule also prevents starvation from becoming an unbounded memory risk. Long-denied sandboxes are prioritized for reconsideration, but they are not admitted unconditionally; every admission still has to satisfy the current headroom and growth-slot constraints.
Actuation through sched_ext. The controller enforces these decisions through sched_ext. Each sandbox is placed in a dedicated cgroup, and the controller publishes an allow/deny decision for each cgroup to a BPF map. Denied runnable tasks are held in a waiting dispatch queue, while allowed tasks are eligible for normal CPU dispatch. This makes memory control proactive: instead of waiting for the kernel OOM path or relying only on post-hoc reclamation, TenonAgent can slow down memory allocation by controlling when allocating sandboxes receive CPU time. Execution control is deliberately separated from reclamation. The scheduler limits concurrent predicted growth, whereas restart-safe teardown handles cases where memory must be actively reclaimed. If Red pressure persists and no sandbox can be safely torn down, the controller continues to re-evaluate headroom and to run only headroom-checked probes. The projection is a scheduling criterion rather than a hard capacity proof: growth estimates may be wrong, and memory can change before the next control iteration.
Implementation
We implement TenonAgent as a user-space controller with Docker and Firecracker sandbox backends. The resource predictor uses a random forest regression model with semantic, scope, and resource-history features to predict memory usage. Runtime execution control is implemented using sched_ext and eBPF. The Docker and Firecracker backends expose a common lifecycle interface over backend-specific shutdown, and restore operations. The backend reports readiness to the controller only after the sandbox is available for action execution. Sandbox memory usage and pressure are collected through cgroup v2. The controller stores per-sandbox execution permissions in a cgroup-keyed BPF map, which the sched_ext scheduler consults when dispatching sandbox tasks.
Evaluation
Experimental Setup
Evaluation modes. We use two complementary evaluation modes: trajectory replay and online LLM-driven execution. Unless otherwise stated, we use replay for repeatable comparisons. Replay trajectories are collected from GPT-5.5-driven agent runs; replay then re-executes the recorded tool calls in real sandboxes, reproduces recorded waiting times, and follows fixed action sequences rather than adapting to failures. Each replay experiment is repeated three times with the same trajectories, submission schedule, and host-memory budget, and we report the average unless otherwise noted.
Workloads. We evaluate our system on representative stateful agent workloads spanning software engineering, scientific research, and reinforcement-learning training:
SWE-bench [49]: Represents complex, multi-turn software engineering tasks where agents navigate repositories, compile code, and execute tests.
ScienceAgentBench [10]: Targets data-intensive scientific research workloads that demand significant memory for data processing and tool execution.
Orchard RL Rollout [34]: Represents reinforcement-learning training environments, generating synchronized bursts of interactive rollout trajectories to stress-test concurrent execution.
Platform. Our experiments run in virtual machines hosted on an Intel Core i9-14900K machine with 128 GiB of DRAM. Each VM is provisioned with the CPU and memory configuration reported in the corresponding figure (e.g., 4 vCPUs and 8 GiB, denoted 4U8G). The VMs run Ubuntu 24.04.4 LTS with Linux 7.0.0-31-generic. We use Docker 29.7.2 for container experiments and Firecracker v1.12.1 for microVM experiments. Agent executions are implemented using the Mini-SWE-Agent framework [44, 49]. Pressure and resident-memory measurements are collected from the workload-domain cgroup, for which swap is disabled.
Baselines. We compare TenonAgent with four baselines:
Eager: runs sandboxes with the default Linux memory management and no resource control.
Fixed-concurrency: statically limits concurrent agents, evaluated under conservative (Static-Low) and aggressive (Static-High) bounds.
Agent-level peak-reservation scheduler: implements a lifetime peak-reservation baseline inspired by the reservation-based admission policy of ThunderAgent [18]. In this baseline, each agent reserves its offline-profiled peak host-memory footprint for the lifetime of its container.
AgentCgroup [54]: uses tool-call-aligned hierarchical cgroups and in-kernel eBPF enforcement to adaptively control agent CPU and memory resources.
Metrics. Across all configurations, workflows encountering an OOM event or sandbox timeout are re-enqueued for up to five retries after the initial attempt. All workflows complete within this limit. We report workload makespan and P50 workflow latency, both including retries, as well as peak aggregate sandbox memory, OOM events, and sandbox timeouts. We also report the attempt-level failure rate, computed as failed attempts divided by total attempts; its denominator may vary across configurations because of retries.
End-to-End Performance
Figure 9 evaluates all methods under a fixed offered load (7.2 QPS over a 10-second submission window) across varying host capacities. TenonAgent consistently achieves the lowest E2E time throughout this range. Under tightly constrained settings (e.g., 4U8G), TenonAgent dramatically outpaces Eager (Unlimited), delivering up to a 5.5× speedup in batch completion on ScienceAgentBench (7.9 vs. 43.4 minutes) and a 2.4× speedup on Orchard RL Rollout (11.8 vs. 28.2 minutes). As shown in Figure 10, this severe E2E inflation in Eager is largely driven by out-of-memory (OOM) failures and task timeouts that force costly workflow retries. By proactively managing memory boundaries, TenonAgent avoids these thrashing behaviors, directly converting reliable execution into substantial throughput gains. Conversely, conservative memory policies do not guarantee efficiency. Both Agent-level and AgentCgroup experience extreme degradation; for instance, under 4U8G, AgentCgroup extends E2E makespans to 120.6 and 293.4 minutes on SWE-bench and ScienceAgentBench, respectively. In contrast, TenonAgent completes these same batches in just 21.3 and 7.9 minutes. Overall, TenonAgent yields massive absolute improvements: up to a 37× speedup over AgentCgroup, nearly 5× over Agent-level reservations (105.6 vs. 21.3 minutes on SWE-bench), and roughly 2× over the best-performing fixed-concurrency slots. This confirms that rigid reservations or tool-call-aligned throttling incur excessive queuing overhead and fail to smoothly accommodate the phase transitions of long-lived agents. We provide a detailed root-cause analysis of why AgentCgroup encounters these extreme execution stalls in Appendix. While abundant resources naturally narrow the absolute performance gap between TenonAgent and Eager (e.g., closing to 9.3 vs. 9.6 minutes on Orchard RL at 8U16G), TenonAgent still consistently delivers superior median (P50) workflow latencies across the board. Ultimately, by effectively bounding tail failures under pressure and proactively reclaiming idle footprints, TenonAgent maximizes batch throughput while remaining highly competitive when resources are plentiful.
Figure 9. End-to-end latency (top), median task latency (middle), and peak memory utilization (bottom) across three workloads and three machine configurations. Numbers above truncated bars report their actual values.
Figure 10. Numbers of tasks that fail because of out-of-memory errors or timeouts. Methods and configurations with no observed failures are omitted.
Figure 11 shows memory utilization and concurrency over time for two workloads. Eager execution sustains high concurrency, creating substantial memory pressure. In contrast, the Best Static policy is conservative and often leaves memory capacity underutilized. TenonAgent dynamically adjusts execution concurrency to the workload’s memory demand, balancing memory utilization against concurrent growth rather than applying a fixed limit.
Figure 11. TenonAgent dynamically regulates memory use and execution concurrency on SW-bench and Orchard RL rollouts.
Portability to Firecracker Backend
To verify whether the benefits of TenonAgent generalize beyond its Docker-based implementation, we migrate the execution backend to Firecracker microVMs and evaluate it under constrained host memory budgets of 8, 12, and 16 GB. As shown in Figure 12, TenonAgent demonstrates consistent robustness across all configurations, achieving a 100% attempt success rate. In contrast, the Eager baseline triggers severe memory contention and out-of-memory (OOM) failures, succeeding in only 20%–70% of attempts. Similarly, aggressive fixed-slot configurations trade reliability for concurrency, frequently crashing when concurrent microVMs
Figure 12. Performance with the Firecracker-based execution backend under different host memory budgets. The left column displays the batch makespan (bars, left axis) and workflow success rate (dotted line, right axis). The right column reports the median (P50) end-to-end workflow latency.
experience overlapping memory spikes. By dynamically regulating residency and execution permissions based on global memory pressure, TenonAgent safely navigates these strict capacity limits.
Beyond simply avoiding failures, TenonAgent consistently outperforms the safe baselines in both throughput and latency. For a fair comparison, we isolate the best static configurations that manage to achieve 100% success at each budget (Static-2, Static-6, and Static-8). Against these conservative baselines, TenonAgent achieves a 1.97×–4.83× speedup in batch makespan and reduces P50 end-to-end workflow latency by 1.7×–4.2×. It also significantly outperforms the agent-level reservation baseline, delivering 3.02×–4.36× makespan reductions. These substantial performance gains emerge because TenonAgent actively reclaims memory from idle microVMs waiting on external LLM inference, repurposing that headroom to admit more active tool executions concurrently.
Overall, these results confirm that TenonAgent’s core design—decoupling logical agent orchestration from physical execution residency—is fundamentally agnostic to the underlying isolation mechanism.
Offered-load Sensitivity
Figure 13 evaluates TenonAgent’s resilience to short-duration load bursts by varying the submission rate (QPS) over a fixed 10-second window. Consequently, higher QPS increases both arrival intensity and the total workflow volume, directly driving up the memory oversubscription ratio (reaching up to 8.6× the physical host capacity at peak demand). This evaluates tolerance to finite-duration bursts rather than sustainable steady-state throughput. The top row of Figure 13 demonstrates a realistic mixed-workflow setting, where diverse execution trajectories prevent peak memory demands from aligning. At low QPS (low oversubscription), TenonAgent and eager execution achieve comparable latencies, indicating minimal scheduling overhead. However, as burst intensity scales and the oversubscription ratio surges, eager execution degrades significantly, suffering severe latency spikes and frequent out-of-memory (OOM) and timeout failures. In contrast, TenonAgent maintains stable end-to-end and P50 latencies while minimizing failures, proving the value of resource-aware control under realistic bursts. The bottom row introduces an adversarial duplicated-workflow stress test, concurrently submitting identical workflows to force their high-memory phases to synchronize. This alignment creates an extreme local oversubscription scenario. Without control, eager execution collapses under this pressure, exhibiting soaring tail latencies and massive OOM failures. Conversely, TenonAgent actively smooths this synchronized demand via admission and execution throttling, maintaining low latency and avoiding failures entirely across all tested loads.
Figure 13. Sensitivity to offered-load Sensitivity. The top row evaluates bursts composed of different tasks, while the bottom row evaluates an extreme duplicated-task burst. Left panels report E2E and P50 latency; right panels report execution failures, separated into OOM and timeout failures.
Ultimately, TenonAgent delivers robust performance under both diverse and worst-case synchronized bursts. It imposes negligible overhead during light traffic while preventing OOM-driven degradation even when the memory oversubscription ratio, defined as the sum of offline-profiled peak memory footprints of all submitted workflows divided by the host memory capacity, is pushed to an extreme 8.6×.
Memory-Region Sizing Sensitivity
We examine how the relative sizes of the RED and YELLOW memory regions affect workload performance and execution reliability. Unlike ordered boundary thresholds, these parameters are defined as percentages of the total memory budget and are varied independently. Figure 14 illustrates a parameter sweep with region sizes ranging from 5% to 25%. The reference configuration (RED = 12.5%, YELLOW = 12.5%) is outlined in orange.
Figure 14. Sensitivity to RED- and YELLOW-region sizes: (a) E2E completion time and (b) execution success rate. Green indicates better outcomes (lower time or 100% success rate), while red indicates worse outcomes. The reference configuration (12.5% for both) is outlined in orange.
Reliability requires sufficient emergency headroom. fig:14b demonstrates that TenonAgent maintains a 100% execution success rate across most configurations. However, reliability drops when both the RED and YELLOW regions are aggressively small (e.g., RED ≤ 5%, YELLOW ≤ 10%). In the RED state, the kernel actuator suspends active sandboxes to halt memory growth. If the RED region is too small, the system lacks the physical headroom to absorb instantaneous allocation spikes (overshoots) that occur between the controller’s observation and the physical enforcement, ultimately resulting in OOM failures.
Performance trade-offs of preventive and reactive control. fig:14a reveals distinct performance penalties for over-provisioning either region. When the YELLOW region is excessively large (e.g., 20%–25%), E2E completion time increases significantly, exceeding 2000 seconds. A large YELLOW zone makes the system overly conservative, triggering premature preventive reclamation of idle sandboxes. This destroys warm environments that could have been reused, introducing severe sandbox reconstruction overhead. Conversely, an oversized RED region (e.g., 20%–25%) stretches completion time by prematurely suspending active growth contributors, unnecessarily reducing execution concurrency before true memory pressure materializes.
The reference configuration (12.5% for both regions) hits the empirical “sweet spot”. It provisions a YELLOW region large enough to give background sandbox teardowns sufficient time to complete, paired with a RED region deep enough to safely buffer active allocation overshoots. This dual-region balance safely maximizes concurrency and achieves the lowest workload makespan.
Evaluation of Memory Prediction
We compare three action-level predictors: Static (uses only action semantics), History-only (reuses the preceding action’s memory demand), and Current (combines semantics with causal execution history). As shown in Table 2, relying on isolated signals degrades prediction quality. The Static predictor suffers from massive numerical errors (e.g., a P90 APE of 442.3%) and low precision (52.0%), generating many false positives by over-predicting heavy actions. Conversely, History-only reduces overall numerical error but its heavy-action recall plummets to 48.8%, proving that past demand alone cannot reliably anticipate sudden memory spikes.
| Method | MAE (MiB) | P90 APE (%) | Precision (%) | Recall (%) |
| Static | 198.6 | 442.3 | 52.0 | 80.0 |
| History-only | 154.3 | 175.2 | 50.7 | 48.8 |
| Current | 93.9 | 88.8 | 77.3 | 82.9 |
Table 2. Direct evaluation of memory-demand predictors. Lower is better for MAE and P90 APE; higher is better for heavy-action precision and recall. Heavy actions have measured peak memory above 1,024 MiB.
Our Current predictor synthesizes both complementary signals, dominating all metrics. Compared to Static, it halves the Mean Absolute Error (MAE) and slashes P90 APE by 80%, while achieving the best balance of heavy-action precision (77.3%) and recall (82.9%). We further demonstrate how this precise demand estimation translates to end-to-end system reliability and latency improvements in § 5.8.
Online Agent Evaluation
Unlike replay-based experiments, this evaluation runs live, LLM-driven agents on SWE-bench and ScienceAgentBench. All online runs use a single workload level on a 4UG VM. We evaluate two Qwen3.8 configurations, Qwen3.8-Flash [35] and Qwen3.8-Max [36], served by the Alibaba Cloud Qianwen platform. For each benchmark and model configuration, we compare eager execution (w/o TenonAgent) with execution under TenonAgent (w/ TenonAgent) using the same task inputs, agent implementation, LLM configuration, resource budget, and workflow arrival schedule. Since online LLM-driven execution is inherently variable, each configuration is repeated five times; bars report the mean and error bars show variation.
Figure 15 reports task accuracy and end-to-end execution time. Across both benchmarks and both Qwen3.8 configurations, TenonAgent preserves task accuracy, with w/ and w/o TenonAgent bars closely matched in all cases. In contrast, end-to-end time consistently decreases under TenonAgent. These results suggest that TenonAgent improves execution efficiency in online setting without an observable loss in task accuracy. We further examine restart-safe coverage and lifecycle overhead. Table 3 reports averages across five runs. SWE-bench executes 1,952.8 actions on average, with 93.4% restartable boundaries; ScienceAgentBench executes 536.2 actions on average, with 100% restartable boundaries. TenonAgent performs 396.8 and 124.4 teardowns on average, reclaiming 33.6 GiB and 8.6 GiB of memory, respectively, with cumulative lifecycle overheads of 805.0 s and 530.4 s. These results show broad restart-safe coverage and substantial memory reclamation, while quantifying the teardown and reconstruction cost.
| Metric | SWE-bench | ScienceAgentBench |
| Actions | 1,952.8 | 536.2 |
| Restartable boundaries (%) | 93.4% | 100% |
| Teardowns | 396.8 | 124.4 |
| Memory reclaimed (GiB) | 33.6 | 8.6 |
| Cumulative overhead (s) | 805.0 | 530.4 |
Table 3. Restart-safe coverage and teardown overhead in higher-load agent runs.
Ablation Study
We evaluate the individual contributions of admission control, memory-growth control, dynamic sandbox residency, and the demand predictor under an 8 GB memory budget. Starting from the full TenonAgent system, we construct five degraded variants. Table 4 summarizes the performance, reliability, and concurrency metrics for each configuration.
| Configuration | OOM events | Sandbox timeouts | End-to-end time (s) | P50 latency (s) | Peak concurrency | Peak memory (MB) |
| TenonAgent | 0 | 0 | 1276 | 522 | 34 | 7415 |
| W/O admission control | 1 | 0 | 1489 (+16.7%) | 721 (+38.1%) | 42 | 7937 |
| W/O memory-growth control | 3 | 0 | 1841 (+44.3%) | 842 (+61.3%) | 27 | 7978 |
| Always resident | 2 | 1 | 1845 (+44.6%) | 1103 (+111.3%) | 43 | 8034 |
| W/ static predictor | 0 | 0 | 2441 (+91.3%) | 1212 (+132.2%) | 20 | 5414 |
| W/ history-only predictor | 2 | 1 | 1706 (+33.7%) | 836 (+60.2%) | 38 | 7965 |
Table 4. Ablation results under an 8 GB memory budget. Each variant removes one mechanism or replaces phase-level control with agent-level control while retaining the remaining mechanisms. Parentheses indicate latency increases relative to the full system. Out-of-memory and sandbox timeout columns report event counts.
Core Runtime Mechanisms. The full system delivers the best overall performance (1276 s E2E, 522 s P50) with zero OOM or timeout failures. Disabling proactive admission control allows unvetted memory growth, increasing E2E time by 16.7% and triggering an OOM event. Removing kernel-level memory-growth control is even more detrimental, increasing E2E time by 44.3% and causing three OOMs, as unexpected allocations during execution go unthrottled. Furthermore, an always resident policy—which disables restart-safe teardown—severely penalizes performance (+111.3% P50 latency). This confirms that static residency inevitably strands memory, whereas dynamic lifecycle decoupling is essential for surviving strict capacity limits.
Figure 15. Online evaluation on SWE-bench and ScienceAgentBench under low and moderate workload levels: (a) task accuracy and (b) end-to-end execution time, comparing eager execution (w/o TenonAgent) with TenonAgent (w/ TenonAgent).
Efficacy of the Predictor. To isolate the value of TenonAgent’s contextual prediction, we evaluate two degraded baselines. A static predictor heavily overestimates memory demands, enforcing a conservative admission policy that starves the system: peak concurrency drops to 20 and memory remains underutilized (5414 MB). While this reduces OOMs, excessive queuing inflates P50 latency. Conversely, a history-only predictor frequently misses sudden memory spikes. It admits actions too aggressively, plunging the system into severe memory contention that causes 2 OOMs and increases E2E time by 33.7% due to recovery overheads. Ultimately, TenonAgent’s full predictor achieves the optimal balance, precisely gauging demand to safely maximize concurrency (34) without triggering failures or inflating latency.
Related Work
LLM Agents and Agentic Serving. Recent agent systems transform LLM calls into long-running, stateful workflows interacting with diverse external environments [28, 47, 48, 49, 50, 56], supported by frameworks providing multi-agent and tool-use abstractions [1, 9, 13, 22, 23, 27]. Emerging research treats these executions as schedulable programs: Alto [38], Autellix [29], Helium [32], and Parrot [26] orchestrate distributed compound systems, while Continuum [24] and ThunderAgent [18] optimize GPU-side KV-cache retention for multi-turn interactions. However, agentic workloads also severely stress CPU-side memory and tool orchestration [31]. Unlike systems predominantly optimizing distributed routing or accelerator inference, TenonAgent addresses the orthogonal bottleneck of host-side memory oversubscription. It explicitly governs the local CPU-side execution substream—managing how and when sandboxes consume memory.
LLM Serving and Sandbox Runtimes. Mainstream LLM serving engines maximize accelerator throughput via iteration-level scheduling and memory management [3, 21, 52, 53, 55]. While essential for inference, they omit the CPU-side environments (e.g., reconstructable workspaces and tool outputs) required by agents [11]. To isolate these substrates, runtimes like Firecracker and gVisor provide high-density containment [2, 4, 7, 14, 15, 25]. For stateful workflows, tools like CRIU [6] and DeltaBox [12] employ OS-level checkpoint/restore (C/R) to freeze process states. However, these VMs and containers preserve the rigid identity of the execution instance. In contrast to traditional C/R mechanisms that rely on heavy memory-heap snapshots to preserve physical state, TenonAgent virtualizes execution residency at the semantic layer by decoupling the logical agent from its physical sandbox.
Discussion and Limitations
Scope of host-resource management. TenonAgent primarily targets host memory capacity, which is non-compressible and often determines failure under oversubscription. Lifecycle limits help bound reconstruction overhead, but TenonAgent does not explicitly model CPU contention, memory bandwidth, or application-level I/O. Although Appendix provides a preliminary I/O analysis, these factors may dominate before memory is exhausted in data-intensive workloads. Extending residency virtualization to multi-resource co-scheduling remains future work.
Sensitivity to workflow dynamics. Residency virtualization relies on idle intervals during external LLM reasoning. If inference latency drops significantly, shrinking reclamation windows could cause sandbox reconstruction overheads to dominate. Furthermore, TenonAgent assumes observable action boundaries within dedicated sandboxes; supporting uncoordinated multi-tenant workloads would require finer-grained intra-sandbox isolation.
Conclusion
In this paper, we present TenonAgent, a runtime system that virtualizes sandbox execution residency by decoupling a logical agent’s lifetime from its underlying physical sandbox. By coordinating boundary-scale residency decisions with kernel-assisted execution pacing, TenonAgent reduces observed out-of-memory failures and delivers up to a 5.5× speedup over unmanaged execution under constrained host budgets. In our evaluated workloads and parameter settings, it achieves a 100% task success rate under bursts reaching an extreme 8.6× memory oversubscription ratio, showing that physical residency can be elasticized to improve high-density agent serving while preserving sandbox-based isolation. TenonAgent provides a practical foundation for memory-oversubscribed agentic AI infrastructure.
References
Parameter Sweep
Figure 16 evaluates two parameters of the user-space boundary-scale scheduler. We vary one parameter at a time while keeping all other mechanisms enabled. The reference configuration uses an 8 GB upper bound for the computed admission window and a lifecycle concurrency limit of two. Under this configuration, the workload completes in 1276 s without OOM or sandbox-timeout events.
Figure 16. Sensitivity to (a) the upper bound of the computed admission window and (b) the lifecycle concurrency limit. Each parameter is varied independently while all other mechanisms remain enabled.
Admission-window upper bound. The admission window is computed from the predicted resource demand of upcoming actions, as described in § 3.4. The parameter studied here is the upper bound imposed on this computed window, rather than a fixed reservation assigned uniformly to every action. When the upper bound is below 8 GB, admission becomes overly conservative and limits useful overlap among actions, resulting in longer completion time. Increasing the upper bound beyond 8 GB does not improve completion time and eventually reduces the observed success rate because more predicted memory demand is allowed to accumulate concurrently. The 8 GB setting therefore provides the best balance between execution concurrency and protection against concurrent memory pressure for this workload.
Lifecycle concurrency limit. Sandbox start, stop, and rematerialization operations involve substantial I/O and share limited bandwidth and host-side resources. The lifecycle concurrency limit therefore serves as a rate limiter, bounding the number of lifecycle transitions that may be active simultaneously. A limit of two achieves the lowest E2E completion time in the sweep. Increasing the limit beyond two creates additional overlap but does not increase effective lifecycle throughput; instead, contention grows and completion time increases. Higher limits also introduce sandbox-timeout events. These results indicate that lifecycle parallelism should be bounded by the available I/O bandwidth and related host resources, rather than maximized independently of the underlying service capacity.
Runtime Control Parameters
Table 5 gives the default configuration for the runtime execution-control specification in § 3.5. The algorithm and its accompanying definitions determine the decision order; this table supplies parameter values rather than an alternative policy.
| Parameter | Default value / definition |
| Footprint | . |
| Sampling interval | 100 ms. |
| Controller period | 100 ms. |
| Scheduler update polling | 100 ms; not a hard bound on actuation latency. |
| Projection horizon | 1000 ms. |
| EWMA factor | 0.35; the first valid raw sample initializes the estimate. |
| Resident band | 4 MiB/s; Resident iff . |
| Bootstrap demand | 16 MiB over the projection horizon, used only until a valid growth estimate exists. |
| Safety margin | 256 MiB. |
| Usable headroom | . |
| Green rule | Allow every live sandbox. Growth-window, contributor-count, and denial-waiting restrictions are bypassed. |
| Yellow budget | , . At most positive-demand sandboxes may be permitted, with aggregate demand at most . |
| Multiplicative decrease | once on each observed increase in pressure severity. |
| Additive increase | Increment by one per ms of continuous Green operation, capped at . |
| Red-drain budget | At most one positive-demand sandbox in the complete permitted set; aggregate demand must remain at most . |
| Minimum denial wait | 1000 ms before a denied sandbox is eligible for admission in Yellow or Red-drain. Green overrides it. |
| Overdue threshold | 3000 ms. Eligible sandboxes reaching this duration are checked before non-overdue candidates; all admission constraints still apply. |
| State preference | For non-overdue candidates: Resident, then Cooling, then Growing/PausedGrowing; smaller projected demand and stable identifier break ties. |
| Pressure hysteresis | No separate threshold hysteresis. Denial waiting and the Green stability timer have the distinct roles defined in the text. |
Table 5. Default parameters for the runtime execution-control specification. Runtime growth accounting is separate from action-level admission accounting.
Control-iteration order. Each control iteration performs the following operations: (1) remove completed sandboxes and register newly observed ones; (2) collect footprint and CPU-time observations; (3) update estimates and states only for valid sample intervals; (4) compute projected demands and pressure; (5) update the concurrency budget; (6) select the complete permitted set; and (7) publish permissions and update denial episodes. All decisions within an iteration use the same observation snapshot and control timestamp.
A completed sandbox is removed from all candidate and permitted sets, and its estimator and denial timer are discarded. A newly registered sandbox has no valid growth estimate, starts in Growing, has no active denial timer, and uses until its first valid sample. Its execution permission is initially DENY until the controller publishes its first decision. If that decision is DENY, the denial timer starts at that iteration.
Controller initialization. The initial permitted set is empty, the initial concurrency budget is , and the previous pressure is initialized to Green for pressure-transition bookkeeping. The Green stability timer starts when the first Green decision is made and is cleared whenever pressure is non-Green.
While pressure remains Green, each completed interval increments once. If a delayed control iteration spans multiple complete stability intervals, the controller applies one increment per complete interval, capped at , and retains the remaining fractional interval. A pressure increase applies multiplicative decrease once per observed transition, not once per control iteration. A decrease in pressure does not directly change .
Measurement validity. The footprint baseline is refreshed at every sample, including samples collected while execution is denied. Consequently, the first subsequent valid growth sample uses the immediately preceding footprint observation rather than accumulating changes over the entire denial episode. An interval containing a policy-permission change, or having no increase in accounted CPU time, is invalid for updating the growth estimate. Such an interval does not supply evidence of reduced growth.
There is no separate inactive-footprint cutoff and no additional re-trust timer. The near-zero band affects the growth-state label, not headroom accounting: any strictly positive predicted demand consumes a contributor slot and is included in the aggregate projection.
Root-Cause Analysis of AgentCgroup Degradation
As observed in § 5.2, the AgentCgroup baseline prevents catastrophic out-of-memory (OOM) crashes but suffers from extreme end-to-end time inflation (e.g., extending ScienceAgentBench makespan to 293.4 minutes under 4U8G). This section details the system-level mechanisms driving this severe degradation.
The core design of AgentCgroup relies on pre-execution profiling to statically classify tasks into “High” and “Low” memory demand categories based on a configurable ratio. It then enforces these classifications using Linux cgroup v2 boundaries. For tasks categorized as “High,” the memory.high limit is left unbounded, allowing them to freely consume available memory. Conversely, tasks classified as “Low” are subjected to a rigid, hardcoded memory.high threshold (e.g., set to 400 MB in our evaluation).
Through extensive parameter tuning, we found that this static categorization fundamentally fails to generalize across the dynamic, multi-turn nature of agentic workflows. The severe latency inflation stems from the OS-level penalty of misconfiguration, which forces a binary dilemma:
Threshold Too High (Under-throttling): If the “Low” threshold is relaxed to accommodate diverse tasks, it effectively neutralizes the flow control. The system acts similarly to the Eager baseline, failing to prevent overlapping memory spikes and ultimately crashing under tight global memory budgets.
Threshold Too Low (Severe Thrashing): When a restrictive threshold (e.g., 400 MB) is strictly enforced, any agent operation (such as loading a dataset or compiling code) that legitimately requires more memory will repeatedly hit the memory.high limit. Unlike memory.max (which triggers the OOM killer), hitting memory.high forces the kernel to synchronously throttle the offending processes. The kernel aggressively forces these tasks into direct memory reclaim, spending CPU cycles on continuously swapping pages in and out.
Consequently, the agent’s tool execution essentially stalls. During our evaluation, we empirically observed severe memory I/O saturation and sustained page-fault storms (thrashing) coinciding with these stalls, as tasks advanced at a glacial pace due to constant block I/O wait and kernel reclaim overhead. This confirms that static, configuration-heavy memory.high thresholds are fundamentally ill-suited for the unpredictable phase transitions of LLM agents.
This fundamental limitation of reactive cgroup mechanisms directly motivated TenonAgent’s architectural shift to sched_ext. While cgroups manage memory capacity reactively—punishing workloads with severe thrashing or OOM kills upon hitting boundaries—TenonAgent leverages sched_ext to proactively govern the rate of memory growth. By intercepting CPU scheduling, TenonAgent smoothly paces the execution of aggressively allocating sandboxes before they trigger kernel-level memory reclaim. This approach completely bypasses the binary dilemma of cgroups, effectively preventing page-fault storms while maintaining safe, high-density concurrent execution.
Restart-Safe Recovery under a Restricted Execution Model
This appendix specifies the contract for safely releasing and reconstructing sandboxes at action boundaries. Unlike OS-level checkpointing (e.g., CRIU), this mechanism operates semantically: it captures explicit persistent state between actions rather than freezing arbitrary running processes.
Supported Execution Model & Eligibility
TenonAgent evaluates recoverability strictly between actions. To qualify for restart-safe teardown, a sandbox must satisfy the following execution constraints:
Decoupled Logical State: The controller manages all workflow progress, LLM context, and conversation history. This state must not depend on sandbox memory.
Stateless Action Processes: Each action runs as a fresh process. Subsequent actions cannot rely on active background daemons, open sockets, interactive shell sessions, or live interpreter heaps created by previous actions.
Explicit Filesystem Persistence: All cross-action mutable state must be confined to designated persistent directories. The rest of the environment is considered disposable and reconstructible from a base image.
Strict Termination: The current action and all its descendant processes must have completely terminated, with their outcomes fully recorded.
If a workflow violates these constraints (e.g., spawns a required background server), the controller conservatively aborts recovery and keeps the sandbox resident.
Persistence and Teardown Protocol
When a sandbox is marked for dematerialization, the controller executes a strictly ordered teardown protocol:
Block Dispatch & Validate: Suspend new action dispatch and verify that the sandbox meets all eligibility constraints mentioned above.
Capture Artifacts: Export all files within the designated persistent directories to durable storage.
Commit Recovery Record: Generate and commit a recovery record to controller-managed storage. This record includes workflow IDs, execution generation, references to the persisted artifacts, and the base environment configuration.
Authorize Teardown: The sandbox is destroyed only after the recovery record is successfully committed.
Rematerialization and Failure Handling
To rematerialize a sandbox, the controller provisions a fresh instance from the recorded base environment, injects the committed filesystem artifacts, and verifies state integrity before dispatching the next action.
Failure Semantics:
Before Teardown: If any step fails prior to committing the recovery record (e.g., artifact upload fails or eligibility checks fail), the teardown is aborted and the sandbox safely remains resident_only.
After Teardown: Once the sandbox is destroyed, fallback to the original instance is impossible. If rematerialization fails, the controller must block execution and retry reconstruction from the committed durable record, rather than silently continuing with an incomplete state.
References
- [1]2025. CrewAI – The Leading Multi-Agent Platform. https://www.crewai.com/. Accessed: 19 August 2025.
- [2]Alexandru Agache, Marc Brooker, Alexandra Iordache, Anthony Liguori, Rolf Neugebauer, Phil Piwonka, and Diana-Maria Popa. 2020. Firecracker: Lightweight Virtualization for Serverless Applications. In 17th USENIX Symposium on Networked Systems Design and Implementation (NSDI). 419–434. https://www.usenix.org/conference/nsdi20/presentation/agache
- [3]Amey Agrawal, Nitin Kedia, Ashish Panwar, Jayashree Mohan, Nipun Kwatra, Bhargav S. Gulavani, Alexey Tumanov, and Ramachandran Ramjee. 2024. Taming Throughput-Latency Tradeoff in LLM Inference with Sarathi-Serve. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI). https://www.usenix.org/conference/osdi24/presentation/agrawalarxiv.org/abs/2403.02310
- [4]Istemi Ekin Akkus, Ruichuan Chen, Ivica Rimac, Manuel Stein, Klaus Satzke, Andre Beck, Paarijaat Aditya, and Volker Hilt. 2018. SAND: Towards High-Performance Serverless Computing. In 2018 USENIX Annual Technical Conference (USENIX ATC). 923–935. https://www.usenix.org/conference/atc18/presentation/akkus
- [5]Emmanuel Amaro, Christopher Brunner-Agur, Zhihong Luo, Amy Ousterhout, Marcos K. Aguilera, Aurojit Panda, Sylvia Ratnasamy, and Scott Shenker. 2020. Can Far Memory Improve Job Throughput? In Proceedings of the Fifteenth European Conference on Computer Systems (EuroSys). https://doi.org/10.1145/3342195.3387522
- [6]Fabio Andrijauskas, Igor Sfiligoi, Diego Davila, Aashay Arora, Jonathan Guiang, Brian Bockelman, Greg Thain, and Frank Wurthewin. 2024. CRIU – Checkpoint Restore in Userspace for Computational Simulations and Scientific Applications. arXiv:2402.05244 [cs.DC] https://arxiv.org/abs/2402.05244
- [7]Lixiang Ao, George Porter, and Geoffrey M. Voelker. 2022. FaaSnap: FaaS Made Fast Using Snapshot-Based VMs. In Proceedings of the Seventeenth European Conference on Computer Systems (EuroSys). 730–746. https://doi.org/10.1145/3492322.35124270
- [8]The Kubernetes Authors. 2024. Kubernetes Documentation. https://kubernetes.io/
- [9]AutoGen. 2024. AutoGen. https://microsoft.github.io/autogen/stable/index.html.
- [10]Ziru Chen, Shijie Chen, Yuting Ning, Qianheng Zhang, Boshi Wang, Botao Yu, Yifei Li, Zevi Liao, Chen Wei, Zitong Lu, Vishal Dev, Mingyi Xue, Frazier N. Baker, Benjamin Burns, Daniel Adu-Ampratwum, Xuhui Huang, Xia Ning, Song Gao, Yu Su, and Huan Sun. 2024. Sci-enceAgentBench: Toward Rigorous Assessment of Language Agents for Data-Driven Scientific Discovery. arXiv:2410.05080 [cs.CL] https://arxiv.org/abs/2410.05080
- [11]Daixuan Cheng, Chen Sheng, Shaohuan Huang, Yuxian Gu, Huatong Song, Guoxin Chen, Li Dong, Wayne Xin Zhao, Ji-Rong Wen, and Furu Wei. 2026. LLM-in-Sandbox Elicits General Agentic Intelligence. arXiv:2601.16206 [cs.AI] https://arxiv.org/abs/2601.16206
- [12]Yunpeng Dong, Jingkai He, Yuze Hou, Dong Du, Zhonghu Xu, Si Yu, Yubin Xia, and Haibo Chen. 2026. DeltaBox: Scaling Stateful AI Agents with Millicsecond-Level Sandbox Checkpoint/Rollback. arXiv:2605.22781 [cs.OS] https://arxiv.org/abs/2605.22781
- [13]Dawei Gao, Zitao Li, Xuchen Pan, Weirui Kuang, Zhijian Ma, Bingchen Qian, Fei Wei, Wenhao Zhang, Yuanxig Xie, Daoyuan Chen, Liuyi Yao, Hongyi Peng, Zeyu Zhang, Lin Zhu, Chen Cheng, Hongzhu Shi, Yaliang Li, Bolin Ding, and Jingren Zhou. 2024. AgentScope: A Flexible yet Robust Multi-Agent Platform. arXiv:2402.14034 [cs.AI] https://arxiv.org/abs/2402.14034
- [14]Google. 2026. gVisor: Application Kernel for Containers. https://gvisor.dev/.
- [15]Google. 2026. NsJail: A Lightweight Process Isolation Tool for Linux. https://github.com/google/nsjail.
- [16]Juncheng Gu, Youngmoon Lee, Yiwen Zhang, Mosharaf Chowdhury, and Kang G. Shin. 2017. Efficient Memory Disaggregation with Infiniswap. In 14th USENIX Symposium on Networked Systems Design and Implementation (NSDI). 649–667. https://www.usenix.org/conference/nsdi17/technical-sessions/presentation/gu
- [17]Eric Jonas, Johann Schleier-Smith, Vikram Sreekanti, Chia-Che Tsai, Anurag Khandelwal, Qifan Pu, Vaishaal Shankar, Joao Carreira, Karl Krauth, Neeraja Yadwadkar, et al. 2019. Cloud programming simplified: A berkeley view on serverless computing. arXiv preprint arXiv:1902.03383 (2019).arxiv.org/abs/1902.03383
- [18]Hao Kang, Ziyang Li, Xinyu Yang, Weili Xu, Yinfang Chen, Junxiong Wang, Beidi Chen, Tushar Krishna, Chenfeng Xu, and Simran Arora. 2026. ThunderAgent: A Simple, Fast and Program-Aware Agentic Inference System. arXiv:2602.13692 [cs.OS] https://arxiv.org/abs/2602.13692
- [19]Ehud Karpas, Omri Abend, Yonatan Belinkov, et al. 2022. MRKL Systems: A modular, neuro-symbolic architecture that combines large language models, external knowledge sources and discrete reasoning. arXiv preprint arXiv:2205.00445 (2022).
- [20]kvcache-ai. 2024. A distributed platform for running agent environments at scale. https://github.com/kvcache-ai/AgentENV.
- [21]Woosuk Kwon, Zhuohan Li, Siyuan Zhuang, Ying Sheng, Liammin Zheng, Cody Hao Yu, Joseph E. Gonzalez, Hao Zhang, and Ion Stoica. 2023. Efficient Memory Management for Large Language Model Serving with PagedAttention. In Proceedings of the ACM SIGOPS 29th Symposium on Operating Systems Principles.arxiv.org/abs/2309.06180
- [22]LangChain. 2024. LangChain. https://github.com/langchain-ai/langchain.
- [23]LangGraph. 2024. LangGraph. https://www.langchain.com/langgraph.
- [24]Hanchen Li, Qiuyang Mang, Runyuan He, Qizheng Zhang, Huanzhi Mao, Xiaokun Chen, Alvin Cheung, Joseph Gonzalez, and Ion Stoica. 2025. Continuum: Efficient and Robust Multi-Turn LLM Agent Scheduling with KV Cache Time-to-Live. arXiv:2511.02230 [cs.DC] https://arxiv.org/abs/2511.02230
- [25]Zijun Li, Yushi Yang, Chen Xing, Jinhe Zhang, Wenbo Wang, Min Li, and Haibo Chen. 2022. RunD: A Lightweight Secure Container Runtime for High-density Deployment and High-concurrency Startup in Serverless Computing. In 2022 USENIX Annual Technical Conference (USENIX ATC). https://www.usenix.org/conference/atc22/presentation/li-zijun
- [26]Chaofan Lin, Zhenhua Han, Chengruidong Zhang, Yuqing Yang, Fan Yang, Chen Chen, and Lili Qiu. 2024. Parrot: efficient serving of LLM-based applications with semantic variable. In Proceedings of the 18th USENIX Conference on Operating Systems Design and Implementation (Santa Clara, CA, USA) (OSDI’24). USENIX Association, USA, Article 50, 17 pages.arxiv.org/abs/2405.19888
- [27]Jerry Liu. 2022. LlamaIndex. https://github.com/jerryjliu/llama_index.
- [28]Xiao Liu, Hao Yu, Hanchen Zhang, Yifan Xu, Xuanyu Lei, Hanyu Lai, Gu Yu, Hangliang Ding, Kaiwen Men, Kejuan Yang, Shudan Zhang, Xiang Deng, Aohan Zeng, Zhengxiao Du, Chenhui Zhang, Sheng Shen, Tianjun Zhang, Yu Su, Huan Sun, Minlie Huang, Yuxiao Dong, and Jie Tang. 2023. AgentBench: Evaluating LLMs as Agents. arXiv:2308.03688 [cs.CL] https://arxiv.org/abs/2308.03688
- [29]Michael Luo, Xiaoqiang Shi, Colin Cai, Tianjun Zhang, Justin Wong, Yichuan Wang, Chi Wang, Yanping Huang, Zhifeng Chen, Joseph E. Gonzalez, and Ion Stoica. 2025. Autellix: An Efficient Serving Engine for LLM Agents as General Programs. arXiv:2502.13965 [cs.LG] https://arxiv.org/abs/2502.13965
- [30]Ian Miell and Aidan Sayers. 2019. Docker in practice. Simon and Schuster.
- [31]Authors Omitted. 2025. A CPU-Centric Perspective on Agentic AI. arXiv:2511.00739 [cs.DC] https://arxiv.org/abs/2511.00739
- [32]Authors Omitted. 2026. Efficient LLM Serving for Agentic Workflows: A Data Systems Perspective. Proceedings of the ACM on Management of Data (2026). https://doi.org/10.1145/3802046
- [33]OpenAI. 2023. Function Calling Guide. https://platform.openai.com/docs/guides/function-calling
- [34]Baolin Peng, Wenlin Yao, Qianhui Wu, Hao Cheng, Xiao Yu, Rui Yang, Tao Ge, Alessandro Sordoni, Xingdi Yuan, Yelong Shen, Pengcheng He, Tong Zhang, Zhou Yu, and Jianfeng Gao. 2026. Orchard: An Open-Source Agentic Modeling Framework. arXiv preprint arXiv:2605.15040 (2026). https://arxiv.org/abs/2605.15040
- [35]Qianwen AI Platform. [n.d.]. Qwen3.8-Flash. https://www.qianwenai.com/models/qwen3.8-flash. Model page. Accessed: 2026-09-25.
- [36]Qianwen AI Platform. [n.d.]. Qwen3.8-Max-0902. https://www.qianwenai.com/models/qwen3.8-max-0902. Model page. Accessed: 2026-09-25.
- [37]Yujia Qin, Shihao Liang, Yining Ye, Kunlun Zhu, Lan Yan, Yaxi Lu, Yankai Lin, Xin Cong, Xiangru Tang, Bill Qian, et al. 2023. ToolLLM: Facilitating large language models to master 16000+ real-world APIs. arXiv preprint arXiv:2307.16789 (2023).arxiv.org/abs/2307.16789
- [38]Deepti Raghavan, Keshav Santhanam, Muhammad Shahir Rahman, Nayani Modugula, Luis Gaspar Schroeder, Maximilien Cura, Houjun Liu, Pratiksha Thaker, Philip Levis, and Matei Zaharia. 2025. Alto: Orchestrating Distributed Compound AI Systems with Nested Ancestry. arXiv:2403.04311 [cs.AI] https://arxiv.org/abs/2403.04311
- [39]Rami Rosen. 2013. Resource management: Linux kernel namespaces and cgroups. Haifux, May 186 (2013), 70.
- [40]Rami Rosen. 2016. Namespaces and cgroups, the basis of Linux containers. Seville, Spain, Feb (2016).
- [41]Zhenyuan Ruan, Malte Schwarzkopf, Marcos K. Aguilera, and Adam Belay. 2020. AIFM: High-Performance, Application-Integrated Far Memory. In 14th USENIX Symposium on Operating Systems Design and Implementation (OSDI). 315–332. https://www.usenix.org/conference/osdi20/presentation/ruan
- [42]Timo Schick, Jane Dwivedi-Yu, Roberto Dessi, Roberta Raileanu, Maria Lomeli, Luke Zettlemoyer, Nicola Cancedda, and Thomas Scialom. 2023. Toolformer: Language Models Can Teach Themselves to Use Tools. arXiv preprint arXiv:2302.04761 (2023).arxiv.org/abs/2302.04761
- [43]Yongliang Shen, Kaitao Song, Xu Tan, Dongsheng Li, Weiming Lu, and Yueting Zhuang. 2023. HuggingGPT: Solving AI Tasks with ChatGPT and its Friends in Hugging Face. arXiv preprint arXiv:2303.17580 (2023).arxiv.org/abs/2303.17580
- [44]Shangyin Tan, Lakshya A Agrawal, Rohit Sandadi, Dan Klein, Koushik Sen, Alexandros G Dimakis, and Matei Zaharia. 2026. Automatically Learning Skills for Coding Agents. In Proceedings of the ACM Conference on AI and Agentic Systems. 1310–1315.DOI
- [45]The Linux Kernel Documentation. 2026. PSI: Pressure Stall Information. https://docs.kernel.org/accounting/psi.html.
- [46]Johannes Weiner, Niket Agarwal, Dan Schatzberg, Leon Yang, Hao Wang, Blaise Sanouillet, Bikash Sharma, Tejun Heo, Mayank Jain, Chuanqiang Tang, and Dmitrios Skarlatos. 2022. TMO: Transparent Memory Offloading in Datacenters. In Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems (ASPLOS). 609–621. https://doi.org/10.1145/3503222.3507731
- [47]Tianbao Xie, Danyang Zhang, Jixuan Chen, Xiaochen Li, Siheing Zhao, Ruisheng Cao, Toh Jing Hua, Zhuojun Cheng, Dongchan Shin, Fangyu Lei, Yitao Liu, Yiheng Xu, Shuyan Zhou, Silvio Savarese, Caiming Xiong, Victor Zhong, and Tao Yu. 2024. OSWorld: Benchmarking Multimodal Agents for Open-Ended Tasks in Real Computer Environments. arXiv:2404.07972 [cs.AI] https://arxiv.org/abs/2404.07972
- [48]Tianqi Xu, Linyao Chen, Dai-Jie Wu, Yanjun Chen, Zecheng Zhang, Xiang Yao, Zhiqiang Xie, Yongchao Chen, Shilong Liu, Bochen Qian, Anjie Yang, Zhaoxuan Jin, Jianbo Deng, Philip Torr, Bernard Ghanem, and Guohao Li. 2024. CRAB: Cross-environment Agent Benchmark for Multimodal Language Model Agents. arXiv:2407.01511 [cs.AI] https://arxiv.org/abs/2407.01511
- [49]John Yang, Carlos E. Jimenez, Alexander Wettig, Kilian Lieret, Shunyu Yao, Karthik Narasimhan, and Ofir Press. 2024. SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineering. In Advances in Neural Information Processing Systems. https://arxiv.org/abs/2405.15793
- [50]Shunyu Yao, Howard Chen, John Yang, and Karthik Narasimhan. 2022. WebShop: Towards Scalable Real-World Web Interaction with Grounded Language Agents. In Advances in Neural Information Processing Systems. https://arxiv.org/abs/2207.01206
- [51]Shunyu Yao, Jeffrey Zhao, Dian Yu, Nan Du, Izhak Shafran, Karthik Narasimhan, and Yuan Cao. 2023. ReAct: Synergizing Reasoning and Acting in Language Models. arXiv:2210.03629 [cs.CL] https://arxiv.org/abs/2210.03629
- [52]Gyeong-In Yu, Joo Seong Jeong, Geon-Woo Kim, Soojeong Kim, and Byung-Gon Chun. 2022. Orca: A Distributed Serving System for Transformer-Based Generative Models. In 16th USENIX Symposium on Operating Systems Design and Implementation (OSDI). 521–538. https://www.usenix.org/conference/osdi22/presentation/yu
- [53]Lianmin Zheng, Liangsheng Yin, Zhiqian Xie, Chuyue Sun, Jeff Huang, Cody Hao Yu, Shiyi Cao, Christos Kozyrakis, Jon Stoica, Joseph E. Gonzalez, Clark Barrett, and Ying Sheng. 2024. SGLang: Efficient Execution of Structured Language Model Programs. arXiv:2312.07104 [cs.AI] https://arxiv.org/abs/2312.07104
- [54]Yusheng Zheng, Jiakun Fan, Quanzhi Fu, Yiwei Yang, Wei Zhang, and Andi Quinn. 2026. Agentcgroup: Understanding and controlling os resources of ai agents. arXiv preprint arXiv:2602.09345 (2026).arxiv.org/abs/2602.09345
- [55]Yinmin Zhong, Shengyu Liu, Junda Chen, Jianbo Hu, Yibo Zhu, Xuanze Liu, Xin Jin, and Hao Zhang. 2024. DistServe: Disaggregating Prefill and Decoding for Goodput-Optimized Large Language Model Serving. In 18th USENIX Symposium on Operating Systems Design and Implementation (OSDI). https://www.usenix.org/conference/osdi24/presentation/zhong-yinminarxiv.org/abs/2401.09670
- [56]Shuyan Zhou, Frank F. Xu, Hao Zhu, Xuhui Zhou, Robert Lo, Abhishek Sridhar, Xianyi Cheng, Yonatan Bisk, Daniel Fried, Uri Alon, and Graham Neubig. 2024. WebArena: A Realistic Web Environment for Building Autonomous Agents. arXiv:2307.13854 [cs.AI] https://arxiv.org/abs/2307.13854









