Errors running TeamCity on low memory computer

I'm trying to run TeamCity on a micro Amazon EC2 instance (~700MB of memory).  I've already reduced the -Xmx switch value for TeamCity itself so that it runs on 256MB of RAM instead of 512MB. But now I get lots of VCS errors from the web site because apparently the git plugin is trying to spawn a java process with 512MB of RAM.  I don't know where the -Xmx switch is for the git plugin.  Can anyone help?

Actual error:
jetbrains.buildServer.vcs.VcsException: 'git fetch' command failed.
stderr: JVMJ9VM015W Initialization error for library j9gc24(2): Failed to instantiate heap; 512M requested
Could not create the Java virtual machine.

at jetbrains.buildServer.buildTriggers.vcs.git.CommandLineUtil.getCommandLineError(
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchDataInSeparateProcess(
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetch(
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchData(
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentVersion(
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.getCurrentVersion(
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.getVersionsForAllRoots(
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$
at java.util.concurrent.Executors$
at java.util.concurrent.FutureTask$Sync.innerRun(
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
at java.util.concurrent.ThreadPoolExecutor$

Comment actions Permalink

Hello Andrew,

you can specify -Xmx option for git plugin using internal property teamcity.git.fetch.process.max.memory. By default it is set to 512Mb.
This and other options for git plugin are described on git plugin page.

Comment actions Permalink

Thanks for the tip, Dmitry. I was able to get it to work by specifying teamcity.git.fetch.separate.process=false in the .BuildServer/config/ file.

If I may suggest, the page may benefit from some more concrete examples of how to set these properties.  

  1. The file is named but the format isn't given (I had to figure out the format by looking at other .properties files and guessing).
  2. The '-D' switch is mentioned when using the script but when I guessed with: "./ start -Dteamcity.git.fetch.process.max.memory=128" that was apparently wrong because TeamCity still reported a memory error with 512MB mentioned.
  3. The environment variables TEAMCITY_SERVER_OPTS and TEAMCITY_SERVER_MEM_OPTS are both named, but the first one is suggested as the 'right' one, although for my issue the latter seems like it ought to be the right one.  Also, what would the format of the value for these variables be?  Space-delimited key=value pairs perhaps?  Or perhaps the '-D' format from above?

Anyway, just a suggestion.  Thanks for your help.

Comment actions Permalink

Andrew, thank you for your suggestion, I will update a documentation.


Please sign in to leave a comment.