You are viewing the documentation of TeamCity 8.x, which is not the most recently released version of TeamCity.
Go to the latest TeamCity documentation or refer to the listing to choose the documentation corresponding to your TeamCity version.


Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  • Determine what process encounters the error (the actual building process, the TeamCity server, or the TeamCity agent)
  • If server is to blame, please check you have increased memory settings from default ones for using the server in production (see the section).
  • If you use x64 JVM, please consider using 32 bit JVM, as it will require less memory (instructions for server).
  • Try to increase the memory for the process via '-Xmx' JVM option, like -Xmx1200m. If the error message is "java.lang.OutOfMemoryError: PermGen space", increase the value in -XX:MaxPermSize=270m JVM option.
    The option needs to be passed to the process with problems:
    • if it is the building process itself, use "JVM Command Line Parameters" settings in the build runner. e.g. Inspections builds may specifically need to increase the parameter;
    • refer to the corresponding documentation for TeamCity server or agent. See also Installing and Configuring the TeamCity server;
  • If the TeamCity server is to blame and increasing memory size does not help, please report the case for us to investigate. For this, while the server is high on memory, take several server thread dumps as described above, get the memory dump (see below), archive the results and send them to us for further analysis. If you have increased Xmx setting, please reduce it to the usual one before getting the dump (smaller snapshots are easier to analyze and easier to upload):
    • to get a memory dump (hprof file) automatically when an OutOfMemory error occurs, add the following JVM option (works for JDK 1.5.0_07+): -XX:+HeapDumpOnOutOfMemoryError. When OOM error occurs next time, java_xxx.hprof file will be created in the process startup directory (<TeamCity home>/bin or <TeamCity Agent home>/bin);
    • you can also take memory dump manually when the memory usage is at its peak. Go to the Administration | Server Administration | Diagnostics page of your TeamCity web UI and click Dump Memory Snapshot.
    • another approach to take the memory dump manually is to run TeamCity server with JDK 1.6+ and use jmap standard JVM util. e.g. jmap -dump:file=<file_on_disk_to_save_dump_into>.hprof <pid_of_your_TeamCity_server_process>