Out of memory: PermGen space

Hello, I get a “Out of memory: PermGen space” error from an ANT build roughly halfway thru completion.  I understand that the recommended solution is to set the following Java options to:

-Xmx1200m –XX:MaxPermSize=270m

…as it is mentioned here:


So I set the following options mentioned above to a the following environment variable that I created on the server:

TEAMCITY_SERVER_MEM_OPTS = -Xmx1200m –XX:MaxPermSize=270m

However even though the JVM arguments reflect those two options, as seen in the Adminstration>Diagonstics>Troubleshooting> JVM arguments section of TeamCity, I still feel uncertain that I set the JVM options correctly.

Did I interpret the instructions correctly?  Because regardless if the TEAMCITY_SERVER_MEM_OPTS variable is set, the results are the same.  Do I need set something else?  Attached are my thread dumps prior to the exception.


Comment actions Permalink

You need to change the JVM settings for the build configuration not the build server. Edit the build configuration and in the Build Step change the JVM command line parameters for your Ant build to set the memory, you possibly don't need to set them as high as the values you tried on the server.


Comment actions Permalink

That worked!  Thanks Rod!  I had to set all three JVM options, as illustrated in the screenshot below:



Please sign in to leave a comment.