java.lang.OutOfMemoryError: GC overhead limit exceeded

Oct 1, 2013 at 5:53 PM
Hi,

Is there an environment variable somewhere we can change to fix this?

Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
    at java.text.DecimalFormat.parse(DecimalFormat.java:1360)
    at java.text.SimpleDateFormat.subParse(SimpleDateFormat.java:1561)
    at java.text.SimpleDateFormat.parse(SimpleDateFormat.java:1281)
    at java.text.DateFormat.parse(DateFormat.java:352)
    at com.microsoft.tfs.core.ws.runtime.xml.XMLConvert.parseDateTime(XMLConvert.java:724)
    at com.microsoft.tfs.core.ws.runtime.xml.XMLConvert.toCalendar(XMLConvert.java:505)
    at ms.tfs.versioncontrol.clientservices._03._GetOperation.<init>(_GetOperation.java:64)
    at ms.tfs.versioncontrol.clientservices._03._Repository4Soap_GetResponse.readFromElement(_Repository4Soap_GetResponse.java:112)
    at ms.tfs.versioncontrol.clientservices._03._Repository4Soap12Service$56.readSOAPResponse(_Repository4Soap12Service.java:1501)
    at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequestInternal(SOAPService.java:668)
    at com.microsoft.tfs.core.ws.runtime.client.SOAPService.executeSOAPRequest(SOAPService.java:473)
    at ms.tfs.versioncontrol.clientservices._03._Repository4Soap12Service.get(_Repository4Soap12Service.java:1491)
    at com.microsoft.tfs.core.clients.versioncontrol.internal.WebServiceLayer.get(WebServiceLayer.java:913)
    at com.microsoft.tfs.core.clients.versioncontrol.internal.WebServiceLayerLocalWorkspaces.get(WebServiceLayerLocalWorkspaces.java:814)
    at com.microsoft.gittf.core.tasks.UpdateLocalVersionToLatestBridgedChangesetTask.getLatestDownloadedChangesetGetOps(UpdateLocalVersionToLatestBridgedChangesetTask.java:95)
    at com.microsoft.gittf.core.tasks.UpdateLocalVersionToLatestBridgedChangesetTask.getGetOperations(UpdateLocalVersionToLatestBridgedChangesetTask.java:74)
    at com.microsoft.gittf.core.tasks.UpdateLocalVersionTask.run(UpdateLocalVersionTask.java:82)
    at com.microsoft.gittf.core.tasks.framework.TaskExecutor.execute(TaskExecutor.java:145)
    at com.microsoft.gittf.core.tasks.CreateWorkspaceTask.run(CreateWorkspaceTask.java:156)
    at com.microsoft.gittf.core.tasks.framework.TaskExecutor.execute(TaskExecutor.java:145)
    at com.microsoft.gittf.core.tasks.WorkspaceTask.createWorkspace(WorkspaceTask.java:137)
    at com.microsoft.gittf.core.tasks.WorkspaceTask.createWorkspace(WorkspaceTask.java:103)
    at com.microsoft.gittf.core.tasks.CheckinHeadCommitTask.run(CheckinHeadCommitTask.java:249)
    at com.microsoft.gittf.core.tasks.framework.TaskExecutor.execute(TaskExecutor.java:145)
    at com.microsoft.gittf.client.clc.commands.CheckinCommand.run(CheckinCommand.java:226)
    at com.microsoft.gittf.client.clc.Main.main(Main.java:328)

Thanks,

CD
Developer
Oct 1, 2013 at 6:44 PM
Hi,

You probably should increase the heap memory size using -Xmx parameter of JVM you use. If you look at the git-tf.cmd script in yout Git-TF installation directory (or git-tf - depending on OS you use) and find the line like
java -ea -Xmx512M -cp %GITTF_CLASSPATH% ...
you will see that the default value specified in not too big, i.e. 512m. Try to increase it to 1024m or bigger.

Alex
Oct 1, 2013 at 11:37 PM
Hi Alex,

We tried 1024 and 2048M and it still fails with the same error. Should we try a larger number?

Any other suggestions?

Thanks,

CD
Developer
Oct 2, 2013 at 1:10 PM
Hi,

Yes, you could try. On the other hand if you search Internet for " java.lang.OutOfMemoryError: GC overhead limit exceeded", you could find more recommendations.

E.g.
Disable alert or Change Garbage Collector Policy

Alex
Oct 2, 2013 at 3:34 PM
Hi,

It appears to be a problem with the cmd script file? We looked at the command line in the system monitor and it's still using 512m instead of the values we've plugged in. It doesn't matter what values we use and we're copying the line you have above.

java -ea -Xmx1024m -cp %GITTF_CLASSPATH% "-Dcom.microsoft.tfs.jni.native.base-directory=%BASE_DIRECTORY%native" com.microsoft.gittf.client.clc.Main %*

We're on RHEL6.2 ES 64-bit and it's using the Java 1.6 openjdk.

So the command line for the process it's using when we look on the system monitor is this still:

java -Xmx512M -classpath ....

So is it possible you can't override that value in this version of Java? Any suggestions? Will an environment variable work better?

Thanks,

CD
Developer
Oct 2, 2013 at 3:37 PM
A GC overhead limit is unlikely to be alleviated by heap size.

You may wish to tweak the GCTimeLimit and GCHeapFreeLimit values.
Developer
Oct 2, 2013 at 3:48 PM
Hi,

Also, please note that it looks like you changed a wrong file. As I said, depending on OS you're using, you should modify either git-tf.cmd or git-tf script. For Linux system it is git-tf. Please modify the java call at the end of the git-tf script (lines 79-81):
exec java -Xmx512m -classpath "$GITTF_CLASSPATH" \
    "-Dcom.microsoft.tfs.jni.native.base-directory=$BASE_DIRECTORY/native" \
    com.microsoft.gittf.client.clc.Main "$@"
Alex
Marked as answer by martin on 10/3/2013 at 11:57 AM
Oct 2, 2013 at 4:33 PM
Hi,

Yes, we missed that. So Linux is using git-tf (no extension) and Windows is using (.cmd).

It works with 1024 and we did not need to tweak anything else.

Thanks,

CD
Developer
Oct 2, 2013 at 4:35 PM

Hi,

I’m glad to hear that. Congratulations!

Alex