Limit memory usage of git processes by configuring `gitconfig` defaults
Both Gitaly and Geo teams have observed that because the default git config allows for unlimited memory usage, it's possible for any git command-line operation (e.g.
git upload-pack, etc.) to use an unlimited amount of memory and make the system unusable.
We have lots of related memory issues here that make me wonder if we should set some reasonable defaults. For example, these are the Gerrit settings:
[core] packedGitLimit = 4g # around 50% of JVM heap packedGitOpenFiles = 8192 # don't forget to configure ulimit streamFileThreshold = 2047m # avoids pathological inflate deltaBaseCacheLimit = 50m # applies to `jgit gc` [pack] bigFileThreshold = 20m # don't delta compress big binaries indexVersion = 2 # use index v2
Should we consider setting these in omnibus?