TeamCity how to set JVM Arguments
Asked Answered
M

3

12

my teamcity build server has following JVM Arguments:

-Xmx512m -XX:MaxPermSize=270m

sometimes it shows some memory problem message like "TeamCity server memory usage for PS Old Gen pool exceeded 91% of 341 MB maximum available. 437 MB used of 506 MB total heap available. See the TeamCity documentation for possible solutions."

i read here https://confluence.jetbrains.com/display/TCD8/Installing+and+Configuring+the+TeamCity+Server#InstallingandConfiguringtheTeamCityServer-SettingUpMemorysettingsforTeamCityServer that the minimum recommended settings are: -Xmx750m -XX:MaxPermSize=270m.

how/where do i change this setting?

Manvel answered 24/4, 2015 at 12:48 Comment(0)
I
5

Internal properties are read after the JVM is started and so the heap settings will not take effect if put where another answer suggests. I was looking into how to do this for a TeamCity container and the best option seems to be to use environment variables (TEAMCITY_SERVER_MEM_OPTS). For a container, those can be set by passing -e TEAMCITY_SERVER_MEM_OPTS='...' when creating the container.

Interfluent answered 19/7, 2019 at 19:40 Comment(0)
P
4

In TC9+ it is possible to set this variable in TC Server GUI: Administration -> Diagnostics -> Internal Properties -> Edit internal properties

For 64-bit JVM the recommended setting is:

TEAMCITY_SERVER_MEM_OPTS=-Xmx4g -XX:MaxPermSize=270m -XX:ReservedCodeCacheSize=350m

Just add this line to the Internal properties edit box

Phyto answered 29/5, 2017 at 9:16 Comment(0)
B
3

I would recommend adding the JVM memory options in the startup script (start.sh) for server based startup using the variable TEAMCITY_SERVER_MEM_OPTS . Please do not set it in the profile of the userid that runs teamcity.

This link should be helpful to you.

In case you want different memory settings for server and agent(usually that's the case), please be selective in naming the variables so that there is a difference in identifying the JVM options for server and agent startup.

As a rule of thumb for teamcity setups, I normally let my teamcity server have 20% more memory than my avg usage to account for any increased load during peak usage periods.

Bilocular answered 26/4, 2015 at 21:16 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.