Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TeamCity how to set JVM Arguments

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?

like image 628
SLimke Avatar asked Apr 24 '15 12:04

SLimke


2 Answers

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.

like image 183
Biswajit_86 Avatar answered Oct 23 '22 09:10

Biswajit_86


For the record, Igor's answer is wrong. Not sure why it was upvoted. I cannot comment or down vote because my rep numbers are low. However, internal properties are read after the JVM is started and so the heap settings will not take effect if put there. I was looking into how to do this for a TeamCity container. 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.

like image 40
redusek Avatar answered Oct 23 '22 09:10

redusek