Resolution
Octopus Server memory normally rises with workload and often stays high after a busy period, because .NET keeps freed memory for reuse. Check how many deployments are running on the OCtopus Server.
Symptom
Octopus.Server.exe on Windows, or the Octopus Server container on Docker or Kubernetes, uses more memory than expected, memory alerts fire on the host, or the process or container restarts. In severe cases you'll see one of these:
System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.
Out of memory: Killed process 1234 (Octopus.Server)
On Docker or Kubernetes, the container exits with code 137 and reports OOMKilled.
Scope: when this is the right article
Use this article for a self-hosted Octopus Server on Windows, or in a Linux container on Docker or Kubernetes. It doesn't cover high memory on Tentacles, workers, or the SQL Server hosting the Octopus database. SQL Server is designed to use most of the memory it's given.
Cause
Common causes:
- Lots of deployments, runbooks, or health checks running at once
- Projects or tenants with very large variable sets
- API Scripts polling the Octopus API frequently
- Large retention cleanups or lots of scheduled triggers firing together
- Steps running on the built-in worker, which run tasks on the Octopus Server host
- Other applications on the same host, or a container memory limit that's too low
Diagnosis and fix
Is the memory use abnormal?
Different tools report different figures:
- Working set (Task Manager on Windows) is memory currently in RAM. It moves up and down on its own.
-
Container memory (
docker stats,kubectl top pod) is measured against the container limit, not the host's RAM, and can include file cache.
Track memory for a few days and compare it with the Tasks page in Octopus:
- Spikes during busy periods, then levels off: expected.
- Grows as you add projects, tenants, or deployments, then stays stable: your workload needs more memory.
- Keeps climbing overnight and at weekends, and never levels off: possible leak. Try the mitigations below, then contact Support.
Is it Octopus or the host?
Check total memory on the host (Task Manager > Performance on Windows, or free -h on the Docker host) and sort processes by memory. If something else is the biggest consumer, often SQL Server on the same machine, the host is the problem. Processes like pwsh, bash, or Calamari usually mean tasks are running on the built-in worker.
On a high availability cluster, compare nodes under Configuration > Nodes. A single high-memory node is often just running more tasks.
Docker and Kubernetes checks
free and top inside a container show the host's memory, not the container's limit. Run these from the host, replacing octopus with your container name:
docker stats --no-stream octopus
docker inspect --format 'OOMKilled={{.State.OOMKilled}} ExitCode={{.State.ExitCode}} MemoryLimit={{.HostConfig.Memory}}' octopus
docker exec octopus cat /sys/fs/cgroup/memory.max
free -h
vmstat 5 5
sudo dmesg -T | grep -i -E "out of memory|killed process"
Non-zero si/so values in vmstat mean the host is swapping, which slows Octopus down before anything runs out. On Kubernetes, kubectl describe pod <pod-name> shows OOMKilled under Last State.
Mitigations
- Lower the task cap under Configuration > Nodes > Change Task Cap, and stagger scheduled triggers. See Increase the Octopus Server task cap.
- Reduce how often integrations poll the API, and use paging and filters.
- Move steps using the built-in worker to external workers, and move SQL Server and other apps to separate machines.
- Add memory to the host. For large workloads, consider High Availability.
- Raise the container limit (
--memory,mem_limitin Compose, orresources.limits.memoryin Kubernetes), leaving enough for the host. - If you need to free memory now, put Octopus into maintenance mode, let running tasks finish, and restart. If memory returns to the same level, it's driven by workload.
When to contact Octopus Support
Contact Octopus Support if memory keeps growing during quiet periods, the server still runs out of memory after you've reduced load and added memory, or memory use changed after an upgrade with no change in workload. Include:
- Octopus version, number of nodes, and how each is hosted
- Memory, CPU, and container limit for each node
- Memory readings over time, noting busy periods and restarts
- Task cap per node and what you've already tried
- A System Diagnostics Report or the Octopus Server logs from a high-memory period
Verify
Memory levels off or drops after busy periods, the host has memory to spare with little swapping, and the container no longer exits with OOMKilled.