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(CommandLineUtil.java:41)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchDataInSeparateProcess(GitVcsSupport.java:1124)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetch(GitVcsSupport.java:1017)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.fetchBranchData(GitVcsSupport.java:1000)
at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentVersion(GitVcsSupport.java:946)
at jetbrains.buildServer.buildTriggers.vcs.VcsChangesLoader.getCurrentVersion(VcsChangesLoader.java:174)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.getVersionsForAllRoots(VcsManagerImpl.java:530)
at jetbrains.buildServer.vcs.impl.VcsManagerImpl.loadChanges(VcsManagerImpl.java:664)
at jetbrains.buildServer.serverSide.impl.auth.SecuredVcsManager.loadChanges(SecuredVcsManager.java:46)
at jetbrains.buildServer.serverSide.impl.VcsModificationChecker$1.run(VcsModificationChecker.java:11)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:453)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:315)
at java.util.concurrent.FutureTask.run(FutureTask.java:150)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:898)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:920)
at java.lang.Thread.run(Thread.java:736)

3 comments
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.

0
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/internal.properties file.

If I may suggest, the http://confluence.jetbrains.net/display/TCD6/Configuring+TeamCity+Server+Startup+Properties page may benefit from some more concrete examples of how to set these properties.  

  1. The internal.properties 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 teamcity-server.sh script but when I guessed with: "./teamcity-server.sh 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.

0
Comment actions Permalink

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

0

Please sign in to leave a comment.