Process memory usage is high (nodejs livekit agents) (using cloud livekit)

I can see logs in agents instances that alerts of “process memory usage is high”. I have the Ship plan and I don’t understand if I’m being applied memory limits in my agent instances.

My agent is simple, I fetch some instructions from my backend and I use the voice.Agent object.

I wonder if this could be the reason sometimes the agent gets stalled or gets a choppy voice

When defining your Agent Server you can pass in the limit at which you are warned. For NodeJS this is jobMemoryWarnMB, ServerOptions | LiveKit Agents (for Python, for anyone else finding this question, it is job_memory_warn_mb, livekit.agents API documentation ).

Agent Server options are also here: Server options | LiveKit Documentation

The value is set to 500 by default.

I wonder if this could be the reason sometimes the agent gets stalled or gets a choppy voice

It shouldn’t be, although if you increase this limit to 1500 and STILL see these warnings then I would be more suspiscious

Thanks for the response! If it’s likely not causing any issues, why is the warning limit set at 500 MB? Increasing it to 2000 MB removed the warning, but it felt wrong to update the default limit to an arbitrary number.

500MB per job aligns roughly with what we recommend for an agent’s memory when scoping your hardware, Self-hosted deployments | LiveKit Documentation . We have gone back and forth internally on the default warning level, the argument against raising the level is it’s a good indicator of runaway or leaky jobs.

I don’t understand if I’m being applied memory limits in my agent instances

It’s worth also pointing out that this limit is defined by agents-js/agents/src/worker.ts at main · livekit/agents-js · GitHub , which is 0 by default (i.e. no limit)

1 Like