arXiv:2610.25231cs.OSOct 2026

Manuscript Offprint

arXiv:2610.25231

AgentLens: Framework-Aware Characterization and Resource Control for Heterogeneous LLM Agents

Wentao Hong

Abstract

LLM-based agents are increasingly deployed at scale, yet how they behave as host-side system workloads remains poorly understood. We present AgentLens, a cross-framework characterization spanning 10 frameworks and 11 matched coding tasks, instrumented across API boundaries, tool calls, process creation, memory composition, and microarchitectural events, together with a framework-aware coordination architecture for co-located agent instances. Our measurements show that framework orchestration structure, not task content, is the dominant source of resource variance. Framework identity explains 52.95% of peak RSS variance while task content explains only 4.22%, and MetaGPT triggers 117.2 execve events per tool call against 3.0 in CAMEL, a 39× gap on identical tasks. Resource dimensions are also systematically decoupled; the Spearman correlation between peak RSS and subprocess count is only 0.13, making no single metric a reliable proxy for the others. These properties render existing control approaches unsound for co-located agent workloads. Static allocation has no representation of the alternating API-wait and tool-execution phase structure that governs every run. Controllers lacking framework priors cannot distinguish whether observed pressure is structural or transient. Historical percentiles conflate stable framework fingerprints, task-driven variance, and within-run retry dynamics into a figure whose origin cannot be recovered. AgentLens addresses all three with offline framework fingerprints and a phase-aware resource controller that applies differentiated memory coordination through cgroup v2 without instrumenting framework internals. In trace-driven replay across three co-location pairs, AgentLens bounds the protected worker's P95 allocation latency to 5.7–7.1 ms when aggregate demand exceeds the parent budget by 10%, a 2.1×–2.6× improvement over static allocation.

1 Introduction

Large language model(LLM) agents are increasingly used to solve open-ended tasks from software engineering[4, 24, 47], research[16, 35], web automation[20, 51] to interactive social tasks[37, 46]. Rather than serving a single inference, agents typically operate in a ReAct-style loop[40, 48], alternating between reasoning about the next step and executing actions such as tool calls, environment interactions, and state updates in sandboxed containers[3, 13]. As agents are being rapidly deployed in production environments, with major technology providers offering them as managed services and co-locating large numbers of instances on shared hosts, efficient resource management has become a first-order systems concern[1, 6, 8, 9, 15, 17, 34].

Existing research on agent systems has largely followed two directions. One focuses on inference-side efficiency, such as maximizing token throughput[26], KV cache management, and GPU utilization. The other focuses on agent-serving architectures[1, 8, 32], such as multi-agent request scheduling, session management, state hosting, and elasticity. These efforts have substantially advanced agent-serving infrastructure. However, they typically treat the agent as an opaque containerized workload to be scheduled[1, 28, 32], leaving the specific resource demands and execution patterns of the underlying agentic processes largely uncharacterized.

As a growing share of agent execution cost shifts from GPU inference to the host[38], this gap becomes increasingly consequential. Yet without a characterization of how agent execution actually behaves on the host, it is impossible to determine whether existing control interfaces designed for request- or container-level workloads can manage agent resource behavior correctly. Recent work such as AgentCgroup[50] has begun to analyze agent runtimes at the operating-system level and has proposed tool-boundary-aware resource control. However, its scope remains limited to a single framework and intra-agent resource management. A systematic characterization across multiple frameworks and resource dimensions, and a control mechanism that accounts for framework-specific execution structure, remains missing.

First, agent execution is request-paced and bursty instead of continuous. It alternates between intensive tool execution and remote LLM reasoning to produce sharp transitions in host-side demand. The temporal structure of these bursts varies across frameworks because orchestration logic is the dominant source of variance in burst shape and frequency. Second, tool execution creates divergent host-side pressure depending on how each framework orchestrates tasks. Identical agent semantics produce fundamentally different resource footprints. For example, MetaGPT spawns 39×39\times more processes than CAMEL on the same task. These divergent realization paths translate the same logical action into different process structures and kernel overhead across all frameworks. Third, agent workloads exhibit systematic and asymmetric decoupling across resource dimensions. RSS accumulates across rounds and remains elevated during LLM reasoning phases while CPU utilization is near zero. The Spearman correlation between CPU time and peak RSS is only 0.54 and drops to 0.13 between peak RSS and subprocess count. This confirms that single-metric profiling is an insufficient basis for characterizing or provisioning agent workloads.

First, static and equal-split allocation schemes fail because they assume stable resource demand over time. Agent execution instead follows alternating phases with fundamentally different resource profiles. Setting quotas to peak demand wastes resources during idle phases while setting to average causes systematic under-provisioning during bursts. Since these schemes cannot track the phase structure of execution, the mismatch between capacity and demand becomes a structural property of every agent run. Second, existing control approaches lack visibility into framework-specific execution structures. This makes proactive differentiated provisioning impossible regardless of control granularity. The absence of such visibility forces all control decisions to be reactive. Systems respond uniformly to aggregate pressure only after degradation occurs instead of pre-positioning resources according to the specific demand structure of each framework. Third, predictive approaches incorrectly assume that historical consumption reliably forecasts future demand. Agent consumption is jointly shaped by framework orchestration style, task characteristics, and runtime variability. Existing approaches treat run-level consumption as a unified signal without distinguishing stable structural properties from variable execution outcomes. Consequently, forecasts degrade precisely when framework and task diversity is highest.

We present AgentLens, a framework-aware, phase-aware resource coordination framework for co-located AI coding agents. AgentLens builds on a cross-framework host-side characterization that aligns semantic execution events with host-visible telemetry such as cgroup counters[21], subprocess activity[19], PSI signals[44], and microarchitectural counters[43], to recover how different frameworks translate similar agent semantics into different resource behaviors, and uses the resulting evidence to derive offline framework fingerprints, runtime phase signals, and a coordinated control layer for memory, CPU, and PID resources.

This paper makes the following contributions:

  • First, we conducted cross-framework characterization of host-side resource behavior across 10 AI coding agent frameworks along three axes: execution temporal structure, tool-call-induced overhead, and resource usage patterns.

  • Second, we identified three fundamental mismatches between existing resource-control abstractions and agent workload structure, arising in the temporal, structural, and predictive dimensions of control.

  • Third, We proposed a framework- and phase-aware resource controller pairing offline fingerprints. Trace-driven replay shows 2.1×−2.6×2.1 \times -2.6 \times lower protected P95 latency under 10% over-subscription.

References (13)