Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have to clean-up my git repository with git gc. Unfortunately I do get a fatal out of memory error.

ernst@samson:~/htdocs/stockdoo$ git gc
Counting objects: 42368, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (24700/24700), done.
fatal: Out of memory, malloc failed   
error: failed to run repack

This is with git 1.7.4 on Ubuntu 10.4.

Any ideas to get arround this problem?

share|improve this question
    
What version of Git are you using, and on which OS are you using it? –  VonC Jul 5 '11 at 11:04

1 Answer 1

On a 64-bit OS, git requires a huge amount of virtual memory to run git-gc, about 8GB. Normally, nobody limits virtual memory on a 64-bit OS because that kind of defeats the whole point of having a 64-bit OS, but some "uneducated" sysadmins or users do so. If you have a resource limit on virtual memory that's less than 64GB or so, find the person who set it and hit them with a clue bat.

One of the main benefits of 64-bit operating systems is that it means address space is not a scarce resource.

I believe newer versions of git have a fix for this, but the problem is really not in git at all.

share|improve this answer
    
In any multiuser system it is absolutely must to limit virtual memory usage if you are responsible sysadmin. Otherwise any rogue or mistakenly written program can easily initiate OOM killer which could be the worst thing that can happen –  Cougar Mar 14 '12 at 10:07
    
@Cougar: Clean pages of virtual memory can never trigger the OOM killer. You can limit backed pages if you want. –  David Schwartz Mar 14 '12 at 14:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.