Tuesday, February 18, 2014

Help! Git eats all of my memory!

My little server runs a whole a lot of things on 2GB RAM. Then I run git clone with some files as big as 1GB in the repository and the poor server keels over, sticks its legs out and starts pining for the fjords.

The following reduces the amount of memory & resources Git uses. I am obviously sure it will make it crappier, slower and make it run as slow as molasses but at least it won't kill the box. That's a win in my book. Consult the manual for further reading.

git config --global pack.windowMemory "100M"
git config --global pack.packSizeLimit "100M"
git config --global pack.threads "1"