TeamCity throws out of memory exception when fetching git repo

We have a git repo that teamcity tries to fetch.

The step for collecting changes from the vcs root doesn't even finish because it crashes with an out of memory exception:

 

[02:02:00]VCS root 'our_repo develop desktop': Resolving deltas 8%

[02:02:00]VCS root 'our_repo develop desktop': Resolving deltas 16%
[02:02:00]VCS root 'our_repo develop desktop': Resolving deltas 25%
[02:02:05]VCS root 'our_repo develop desktop': Resolving deltas 33%
[02:02:15]VCS root 'our_repo develop desktop': Resolving deltas 41%
[02:02:17]VCS root 'our_repo develop desktop': Resolving deltas 50%
[02:02:26]VCS root 'our_repo develop desktop': Resolving deltas 58%
[02:02:28]VCS root 'our_repo develop desktop': git fetch <<<url_redacted>>> finished
[02:02:28]Failed to collect changes, error: Error collecting changes for VCS repository '"our_repo develop desktop" {instance id=1919, parent internal id=860, parent id=<<redacted>>, description: "<<<url_redacted>>>"}'
'git fetch' command failed (repository dir: <TeamCity data dir>/system/caches/git/git-AB58C813.git).
stderr: Out of memory loading unknown object
stdout: remote: Compressing objects: 5%
remote: Compressing objects: 11%
remote: Compressing objects: 16%
remote: Compressing objects: 22%
remote: Compressing objects: 27%
remote: Compressing objects: 33%
remote: Compressing objects: 38%
remote: Compressing objects: 44%
remote: Compressing objects: 50%
remote: Compressing objects: 55%
remote: Compressing objects: 61%
remote: Compressing objects: 66%
remote: Compressing objects: 72%
remote: Compressing objects: 100%

Receiving objects: 5%
Receiving objects: 11%
Receiving objects: 16%
Receiving objects: 22...

0
1 comment

Hi,

 

The core of the issue seems to be pretty clear, the process doesn't have enough memory to load all the git objects into memory. This seems to be happening on the server, so the first thing to do could be to increase the amount of allocated memory for the process, which you can see in the internal properties described here: https://www.jetbrains.com/help/teamcity/git.html#Git-InternalProperties.

 

Another possibility would be to specify the executable path via the internal property, which will give teamcity the ability of using the installed git version instead of the git library that we carry on teamcity.

0

Please sign in to leave a comment.