Direct answer: start with workload-based sizing, not a universal number

There is no single correct OpenTelemetry Collector memory limit because memory use depends on the number of active pipelines, processors, exporters, batching behavior, queue sizes, cardinality, and temporary serialization buffers. A small collector handling a few thousand spans per second may run comfortably in 128–256 MiB, while a production gateway processing hundreds of thousands of spans or metrics series per second may require 1–4 GiB or more. The most defensible starting point is to measure a representative load, set a conservative limit, and leave at least 20–30% headroom for bursts, garbage collection, and configuration changes. Kubernetes memory limits should generally be higher than the normal observed working set, not merely equal to average RSS. In 2026, the OpenTelemetry Collector remains a collection of Go processes, receivers, processors, and exporters, so its memory profile can change with component versions and enabled features. AWS Distro for OpenTelemetry is an AWS-supported distribution of the Collector, but its distribution identity does not create a different sizing formula.

Also worth reading: What Makes an AI Agent Memory Tutorial Essential for Builders? · Is Jensen Huang a national security threat like Oppenheimer? · How to run a function concurrently with a game loop?

A practical initial rule is to allocate roughly 256 MiB for a low-volume sidecar or agent, 512 MiB–1 GiB for a shared node-level agent, and 1–2 GiB for a gateway receiving substantial telemetry from many workloads. These are starting ranges, not guarantees. Metric streams can be more expensive than expected when labels are unique, and queues create deliberate memory consumption rather than accidental waste. The collector exposes runtime metrics, including accepted and refused spans, queue capacity, failed sends, process memory, and Go runtime statistics, which should drive the final decision. The key question is not simply “How much memory does the Collector need?” but “What is the largest normal and burst workload it must absorb without dropping telemetry or being killed?”

How the OpenTelemetry Collector uses memory

The Collector moves data through pipelines consisting of receivers, processors, and exporters. A receiver accepts telemetry from applications, infrastructure agents, or other services; processors may transform, filter, sample, batch, or enrich it; exporters forward it to a backend such as Amazon CloudWatch, Prometheus-compatible storage, or another observability platform. Each stage can hold data while it processes or waits to send it, so memory depends on throughput, latency, and pipeline configuration as much as on traffic volume. Batching usually improves backend efficiency, but larger batches also increase short-term memory use. A queue protects the pipeline during backend outages, yet an oversized queue can turn a temporary outage into an out-of-memory event. Go garbage collection also means that RSS may remain above the amount of live data for a period after processing.

Memory-heavy operations include transforming large payloads, maintaining metric state, aggregating logs, performing sampling decisions, and holding queued batches. High-cardinality metrics are especially risky: one metric name with thousands of unique label combinations may consume more memory than thousands of differently named but low-cardinality signals. Tail-based sampling can also require a decision window and retained trace data, making it more memory-intensive than simple head sampling. Kubernetes attributes, resource metadata, and nested span structures add overhead. The Collector’s memory should therefore be evaluated by the complete pipeline, not by the receiver alone. A deployment can fit within 512 MiB in normal operation and still fail if a downstream endpoint stalls while several exporters retain full queues.

There is an important distinction between the Collector and the application generating telemetry. The application may buffer data before export, while the Collector can buffer again between pipeline stages. If a host is already close to its memory budget, adding a Collector with a generous limit can cause the operating system or kubelet to terminate another workload. On Kubernetes, the pod memory limit is enforced for the container, while node-level memory pressure can affect the entire node. Monitoring OOMKilled status, restart counts, Go heap metrics, and queue utilization is more informative than watching CPU alone. A stable deployment is one in which memory rises during expected bursts and returns toward its baseline after traffic settles.

A practical measurement procedure

Begin by recording a representative baseline, ideally during normal production traffic rather than a synthetic test with unrealistic label sets. Capture the Collector’s RSS, Go heap in use, heap allocated, garbage-collection activity, queue size, pipeline accepted and rejected item counts, exporter send failures, and upstream request rates. Keep the observation period long enough to include daily or weekly peaks; a 15-minute test cannot expose a metric burst that occurs once per day. If the Collector runs in Kubernetes, record the pod’s containers.memory.working_set_bytes, limit, OOMKilled status, and restart history alongside node memory pressure. If it runs on Amazon ECS, inspect container memory utilization, service scaling behavior, and whether the task is being stopped because of host or container constraints. The AWS Distro for OpenTelemetry documentation for ECS and Container Insights is useful for understanding deployment integration, but it does not replace workload-specific measurement.

After collecting the baseline, increase load gradually in a controlled environment. Test steady traffic, short bursts, downstream failure, and configuration expansion separately. For example, measure normal traffic for 30 minutes, inject a 2× burst for five minutes, block the backend for two minutes, and then allow the queue to drain while observing memory. The goal is to identify the point at which the Collector refuses work, grows queues, or is killed. Avoid disabling safety limits merely to make the test pass. A refusal caused by a full queue may be preferable to uncontrolled memory growth, but sustained refusals indicate that the pipeline needs more capacity, better batching, sampling, or fewer redundant collectors.

A useful sizing calculation is: normal working set plus expected burst growth plus runtime headroom. If a test shows 420 MiB under normal load and 650 MiB during a five-minute burst, a 1 GiB limit provides approximately 37% headroom over the burst and 144% over normal use. That is a reasonable starting margin, not a universal rule. If the backend can stall for 30 minutes and the queue is allowed to fill, calculate the worst-case queued data before choosing the limit. The memory limit should also be compatible with the deployment platform’s scheduling behavior; a 2 GiB request on a resource-constrained node may be more damaging than a carefully tuned 768 MiB request.

Pipeline features that change the sizing requirement

The memory_limiter processor is often enabled to protect the pipeline, but it should not be confused with an absolute memory reservation. It observes memory usage and provides a soft or hard limit depending on its configuration. A commonly used approach is to set a limit slightly below the container limit, leaving room for the Go runtime, sidecars, and measurement overhead. For example, a Collector container with a 1 GiB limit might use a memory limiter spike limit near 768–896 MiB, with a lower soft limit for backpressure. Exact values depend on the deployment and workload; setting the processor limit exactly equal to the container limit can cause abrupt refusal and can make diagnosis harder. Configuration syntax and default behavior can also vary by Collector distribution and version, so the installed release’s documentation and runtime metrics should be checked.

Batch processing is usually operationally attractive because it reduces network calls and backend cost. It does not make data disappear; it changes when data is held in memory. Larger send_batch_size and longer timeout values can improve throughput at the cost of higher and more variable memory. Queues, especially queue-based exporters, should be sized in relation to the acceptable outage duration. A 10,000-item queue that is appropriate for small spans may be inadequate for large log records, and a queue configured for 60 seconds of traffic is not equivalent to one configured for 10 minutes. Processors such as tail sampling, attributes processing, and metric aggregation may need separate load tests because they can create state or transform payloads differently. Tail sampling is particularly relevant when trace volume is high but only a fraction of traces need to be retained.

In Kubernetes, DaemonSet and sidecar patterns have different requirements. A node agent usually receives telemetry from many pods on that node and benefits from local aggregation, while an application sidecar is isolated per workload and may multiply memory overhead across many containers. A centralized gateway can reduce duplicate configuration and improve routing, but it concentrates traffic and failure risk. The Collector’s Go runtime reports are useful for distinguishing live heap growth from garbage-collector lag, while process RSS reflects what the operating system sees. Neither number alone explains the full story. Use queue and exporter metrics to connect memory growth to the pipeline behavior that caused it.

Comparison of common deployment patterns

FeatureAgent or DaemonSetSidecarGateway or collector deployment
Typical memory scopeOne host or nodeOne application containerMany upstream workloads
Initial sizing range256 MiB–1 GiB128–512 MiB per sidecar1–4 GiB or more
Main advantageLocal collection and fault isolationSimple per-application routingCentralized filtering, sampling, and export
Main memory riskNode-wide traffic and large metric cardinalityAggregate overhead across many replicasQueue growth and downstream stalls
Scaling behaviorScale nodes or use multiple agentsReplicate with applicationsScale horizontally by upstream traffic
Best fitKubernetes and ECS node-level telemetrySmall, isolated workloadsLarge fleets with shared pipelines
These ranges describe starting points, not commitments. A low-volume gateway can fit in 256 MiB, while a high-cardinality node agent may exceed 1 GiB. A sidecar approach can become expensive not because each sidecar is individually large, but because hundreds of replicas each reserve 256 MiB even when they use less. A gateway can be more economical in CPU and network terms, yet it becomes a shared dependency. The best architecture is the one whose failure domain, queueing behavior, and scaling model match the service’s telemetry requirements. In AWS environments, Container Insights can provide useful workload visibility, while the Collector’s own telemetry should still be collected because backend visibility cannot diagnose every internal queue or processor condition.

Common mistakes and how to avoid them

The most frequent mistake is choosing memory from the number of hosts rather than the amount and shape of telemetry. A node with 100 low-cardinality metrics may be cheaper than one node producing a metric family with 50,000 unique label combinations. Another mistake is treating the container memory limit as the application’s normal requirement. If the limit is set at the observed average, garbage collection, batching, and a brief traffic burst can trigger an OOM kill. It is also easy to configure generous queues independently in every exporter, multiplying retained data without an overall outage policy. Test queue behavior with a blocked destination, and document the maximum acceptable data loss or delay.

Sampling is another common source of confusion. Head sampling reduces the amount of data sent into the pipeline, while tail sampling can provide more representative results but requires buffering and policy evaluation. Increasing sampling to improve observability can overwhelm a gateway that was sized for earlier traffic. Metric transforms and resourcing attributes can increase memory if they create or retain additional state. Finally, changing a Collector configuration can temporarily increase memory while old and new components coexist, so rolling updates deserve the same headroom as steady-state operation. Do not compare memory only across versions; compare the same workload, component set, and queue policy.

When to increase memory, change the design, or accept a limit

Act when memory follows a repeatable pattern tied to a known traffic peak, when queue capacity is regularly exhausted, when the exporter retries dominate CPU and memory, or when OOM kills and restarts threaten telemetry continuity. Increasing the container limit may solve a temporary burst, but it can also hide a cardinality problem or an undersized batch configuration. First inspect the shape of the data: which receiver produces the most items, which processor retains the most memory, and whether memory is tied to metrics, traces, or logs. If memory grows with the number of unique labels, fix labeling before simply adding gigabytes. If it grows during backend outages, reduce queue retention, add controlled backpressure, improve batching, or use a redundant exporter route.

Do not act solely because RSS is high. A Go process may reserve memory for reuse, and a memory limiter may intentionally allow headroom. Instead, compare the working set with the configured limit, examine Go heap and garbage collection, and correlate the result with queue fullness and error rates. A stable limit might be 768 MiB even if a stress test reaches 700 MiB, provided the peak is brief and the node has capacity. A 4 GiB limit is not automatically safer; it can make scheduling less flexible and may delay detection of runaway cardinality. Capacity planning should include the cost of unused reservation, especially in Kubernetes and ECS deployments where memory requests affect placement and autoscaling behavior.

For AWS-hosted workloads, the Collector itself is software and is not normally billed as a separate managed service; the relevant costs are the compute and storage used by the task or node, network transfer, and the observability backend’s ingestion and retention charges. Enabling more metrics, traces, or logs can therefore increase backend cost more visibly than the Collector’s small process cost. CloudWatch, Prometheus-compatible storage, and other backends may have different pricing for ingestion, queries, retention, and high-volume data. Review the current AWS service pricing and the selected backend’s current terms rather than relying on an old estimate. A memory increase can improve reliability, but it does not guarantee lower total cost if it enables telemetry that nobody uses.

Recommended operating policy

Set a documented baseline for normal memory, peak working set, queue duration, and acceptable refusal behavior. Recheck those values after major pipeline changes, SDK upgrades, traffic growth, or changes in label conventions. Keep at least 20–30% headroom for ordinary variability, and more when the deployment must survive a backend outage or a rolling update. Use alerts based on sustained working-set pressure, OOM kills, queue saturation, dropped or refused items, and exporter failures rather than on a single instantaneous memory reading. The threshold should reflect the actual limit: an alert at 70% of a 512 MiB container is different from an alert at 70% of a 4 GiB container.

The durable approach is therefore iterative. Start with a conservative deployment range, measure real traffic with Collector and infrastructure metrics, deliberately test bursts and failures, and adjust either memory or pipeline behavior based on evidence. For most teams, 256 MiB is enough for a quiet agent, 512 MiB–1 GiB is a sensible node-agent range, and 1–2 GiB is a reasonable gateway starting point, but production exceptions are common. High-cardinality metrics, tail sampling, large batches, and long queues can move a deployment into substantially higher ranges. The correct limit is the smallest value that preserves the required telemetry and operational safety under tested peak conditions.