{"message": "process memory usage is high", "level...
# ask-ai
c
{"message": "process memory usage is high", "level": "WARNING", "name": "livekit.agents", "memory_usage_mb": 586.70703125, "memory_warn_mb": 500, "memory_limit_mb": 0, "pid": 7925, "timestamp": "2025-11-03T092348.946006+00:00"} how to stop the above log?
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.
I understand that seeing the warning log about memory usage can be a bit concerning. This message appears because your process has gone over the default memory warning threshold of 500MB. The good news is, you have the flexibility to adjust or even disable these warnings by changing the memory warning thresholds in your agent's settings. For Python Agents:
Copy code
from livekit.agents import WorkerOptions

# Option 1: Disable memory warnings entirely
opts = WorkerOptions(
    job_memory_warn_mb=0,  # Set to 0 to disable warnings
    # ... other options
)

# Option 2: Increase the warning threshold
opts = WorkerOptions(
    job_memory_warn_mb=1000,  # Increase from default 500MB to 1000MB
    # ... other options
)
For JavaScript/TypeScript Agents:
Copy code
const procOpts = {
  memoryWarnMB: 0,        // Set to 0 to disable warnings
  memoryLimitMB: 0,       // Memory limit (0 = disabled)
  // ... other options
};
While adjusting these settings is totally fine, it might also be helpful to take a closer look at the memory usage itself. Sometimes, this can reveal opportunities to optimize or catch memory leaks early. Please feel free to reach out if you'd like any help with that or if you have any other questions—I’m here to support you! Sources: livekit-agents/livekit/agents/worker.py | agents/src/ipc/supervised_proc.ts
c
in python, where do i write this?
t
Hi there! When you're working with Python, you can set up
WorkerOptions
while calling
cli.run_app()
inside the main part of your agent script. Usually, this happens within the
if __name__ == "__main__":
section of your main Python file. Here’s a little example to guide you:
Copy code
if __name__ == "__main__":
    cli.run_app(WorkerOptions(
        entrypoint_fnc=entrypoint,  # Your main function for handling jobs
        job_memory_warn_mb=1000     # Adjust memory warning threshold here
    ))
Just swap out
entrypoint
with the name of your function that processes the jobs. If anything feels unclear or you want me to walk you through it step-by-step, please don’t hesitate to ask—I’m here to help! Sources: python-agent-example-app/main.py | livekit-agents/README.md | Worker options | LiveKit Docs | metrics/send-metrics-to-3p/send_metrics_to_3p.py | main.py