`process memory usage is high` getting this log, ...
# ask-ai
c
process memory usage is high
getting this log, on my agent
t
Thanks for reaching out, Subham. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
c
Copy code
{
  "stream": "stdout",
  "level": "WARNING",
  "service": "cloud.livekit.io",
  "memory_usage_mb": 582.86328125,
  "host": "CAW_XKEzZBoosZ2A",
  "name": "livekit.agents",
  "pid": 41473,
  "source": "CA_PuovLhQDNhZu",
  "memory_limit_mb": 0,
  "timestamp": "2025-10-31T06:16:37.047063+00:00",
  "memory_warn_mb": 500
}
t
It looks like you've encountered the log message "process memory usage is high," which means a process is using more memory than the warning threshold set in your system. Don’t worry—we can work through this together! Here are some friendly steps to help you troubleshoot and resolve the issue: 1. First, take a look at the agent logs to get more insight into the memory usage. Pay special attention to the values for
memory_usage_mb
,
memory_warn_mb
, and
memory_limit_mb
. 2. Next, consider the workload your agent is handling. Sometimes features like enhanced noise cancellation or VAD plugins can cause memory use to climb. 3. You might want to adjust the memory thresholds in your configuration. For example, increasing the
job_memory_warn_mb
value can help reduce warning messages, or setting a
job_memory_limit_mb
can enforce stricter limits if needed. 4. If your setup involves Docker or cgroup-managed environments, double-check that the agent recognizes any container-imposed memory limits by reviewing cgroup files such as
/sys/fs/cgroup/memory/memory.usage_in_bytes
. 5. Also, keep an eye out for external factors like AI models that have high memory demands, as these can contribute to increased usage. If you continue to experience issues, please don’t hesitate to share more details—like your agent version, deployment environment, and any relevant log excerpts. I’m here to help you every step of the way! Sources: utils/hwstats/memory_linux.go | Still Have Questions | livekit-agents/livekit/agents/worker.py | agents/src/ipc/supervised_proc.ts | Deploying to custom environments | LiveKit Docs
It looks like the log is showing that the memory usage of the process has gone over the warning threshold of 500 MB, reaching around 582.86 MB. Since there’s no memory limit set (as shown by
memory_limit_mb: 0
), the process won’t be stopped automatically. Here are a few steps you might consider: • If this level of memory use is normal for your workload, you might want to increase the
memory_warn_mb
threshold. • If you'd prefer to have a memory limit in place, you can set a value for
memory_limit_mb
in the
WorkerOptions
configuration. • Take a look at the agent’s workload to spot any memory-heavy tasks, like enhanced noise cancellation or VAD plugins, and see if there’s room to optimize. If you’d like, I’m here to help you adjust these settings or dig deeper into the workload analysis. Just let me know!
c
It's deployed on cloud, how to resolve this? How to increase the memory threshold and how to check for optimizations
t
For LiveKit Cloud deployments, memory thresholds and resource allocation are managed automatically, so direct customization of memory settings isn’t supported. But don’t worry! You can still optimize your deployment by: • Keeping an eye on resource usage through the LiveKit Cloud dashboard to spot any memory-heavy tasks. • Designing your agents efficiently, avoiding extra memory use from features like enhanced noise cancellation or VAD plugins when they’re not needed. • Relying on LiveKit Cloud's autoscaling, which smartly adjusts resources to handle any increase in workload. If you feel you need more control over memory thresholds and optimizations, self-hosting your LiveKit agents might be a great option. This way, you can: • Set memory warning and limit thresholds using the
WorkerOptions
configuration. • Implement your own custom memory-based load balancing functions. • Adjust container-level memory limits if you’re deploying with Docker or similar tools. Please feel free to reach out if you’d like me to walk you through self-hosting or if you need any help optimizing your current setup. I’m here to help! Sources: Deploy and scale agents on LiveKit Cloud | Worker options | LiveKit Docs | fly.io/fly.toml | livekit-agents/livekit/agents/ipc/supervised_proc.py | Deploying to custom environments | LiveKit Docs
c
Does this mean that it doesn't affect the performance of my agents?
t
In LiveKit Cloud, we’ve designed the platform’s automatic resource management to make sure that if one agent is using a lot of memory, it won’t slow down the performance for other agents or the system as a whole. The autoscaling feature steps in to allocate extra resources whenever needed, so everything keeps running smoothly even with increased workloads. That said, if you notice that a particular agent’s memory usage is consistently higher than expected, it might be a sign that the agent’s workload or configuration could be fine-tuned. While this won’t impact other agents, optimizing that agent can really help boost its performance and reduce how much memory it uses. I’m here to help! Just let me know if you’d like me to assist you in reviewing or optimizing your agent’s workload.