astonishing-horse-62951
10/02/2025, 5:10 AMtall-airline-16756
10/02/2025, 5:10 AMtall-airline-16756
10/02/2025, 5:11 AMmemoryWarnMB and memoryLimitMB values in the agent’s configuration.
• Optimize Agent Code: Take a look at your code to spot any memory inefficiencies, like making sure unused resources are released or using streaming for handling large data.
• Scale Resources: Double-check that your deployment environment has enough memory. For memory-heavy tasks, LiveKit suggests 4 cores and 8GB RAM per worker.
• Monitor Concurrent Jobs: Try to limit how many memory-intensive jobs run at the same time on each worker to prevent overload.
• Use Efficient Models: Consider optimizing your models for better runtime performance and lowering frame sampling rates or image resolution if you’re working on vision tasks.
• Deploy on Adequate Infrastructure: Platforms like Kubernetes or LiveKit Cloud can give you better control over memory allocation, which might be helpful.
Following these steps should make it easier for you to manage and resolve the high memory usage warning. If you need any more help, feel free to reach out—we’re here to support you!
Sources: Deploying to custom environments | LiveKit Docs | README.md | Docs::Agents | livekit-agents/livekit/agents/ipc/inference_proc_executor.py | agents/src/ipc/supervised_proc.tsastonishing-horse-62951
10/02/2025, 5:15 AMtall-airline-16756
10/02/2025, 5:16 AMastonishing-horse-62951
10/02/2025, 5:20 AMtall-airline-16756
10/02/2025, 5:20 AMChatContext with 500k characters might seem a bit overwhelming in terms of memory usage. Let me walk you through some important limits we have in place to help manage this:
• Message Size Limit: Each message can only be up to 1024 characters long. So, a single message with 500k characters would actually be cut off.
• Message Count Limit: A ChatContext can hold up to 40 messages. If there are more, the extras will be trimmed.
These limits are here to protect your system from running out of resources. That said, working with large amounts of data—like splitting or handling those 500k characters—can still use more memory and might cause warnings.
Hard Memory Limit: There’s a configurable hard memory limit per process. By default, it’s turned off (set to 0), but if you enable it and go over the limit, the process will stop. You can tweak this using the memory_limit_mb setting in your agent’s configuration.
If you’re seeing memory warnings, it might help to optimize how you handle your data or increase the memory limits if your application really needs to work with large contexts. I’m here to help if you want to explore those options together!
Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | pkg/stats/monitor.go | LiveKit