I'm trying to make TeamCity build a medium-large project, and it's failing when calling 'git fetch' with java.lang.OutOfMemoryError. I've read about this being possible if checking out on server, but the VCS checkout mode is set to "Always check out files on agent". Before that, it was set to checking out on the server, but I've since changed that. Git version is 220.127.116.11 on the agent machine.
I've tried increasing the maximum memory for the agent from 512MB to 2048MB, but to no avail. Is there anything else I should do, that I didn't consider?
If I'm posting in the wrong place or not following some of the rules, I'll be happy to edit this post, or delete it and post it somewhere else.