Maximum number of threads for a teamcity agent

Hello,

I have an agent with little swap, on which I cannot set overcommit to 1, and when I fork the build process to run an app server it fails with an cannot allocate memory error.

One thing I noticed is that there is quite a lot (6) of teamcity agent threads - each taking memory - and I was wondering if there is an option to limit their number? The agent will run at most one build at a time anyway, so 1 would be enough ;).

Adam

2 comments

Ok, that was a very stupid question, but well, happens ;). Too long looking at htop :D

Anyway, what is the minimum memory required for an agent? The default is 384 but can I go lower than that? (I decreased to 128 and so far works ... ;) )

Although the launcher process is taking up 401m for some reason.

Adam

0

Adam,

> Anyway, what is the minimum memory required for an agent? The default is 384 but can I go lower than that? (I decreased to 128 and so far works ... ;) )

The minimum amount of memory depends on the agent plugins used and also on the portion of a build log thatagent stores until it gets sent to the server. This latter depends on the size/update speed of the build log and also server inavailability time. Usually we consider that agent process overhead and memory consumption can be neglected (as build process usually requires much more resources).

You can try to reduce amount of memory for the agent by changing -Xmx JVM parameter in TEAMCITY_AGENT_MEM_OPTS environment variable, but prepare to get OutOfMemory erorrs when memory fills up.

> Although the launcher process is taking up 401m for some reason.

Do you mean the first (parent) of the two agent's java processes?  That is strange, especially if this happens not during agent upgrade. Feel free to post an issue into our tracker with details. If would be cool to get a memory dump, but that can be not trivial if you do not have Java development experience.

Please also make sure you use 32 bit JVM to run agent.

0

Please sign in to leave a comment.