rails + git + heroku - error on git push rails + git + heroku - error on git push heroku heroku

rails + git + heroku - error on git push


Most of the problem-solving is in the comments above; by the time we moved over to chat, things were pretty much taken care of. Here's an answer, just to help close out the question.

It seems that there was some unknown problem in the repository causing the objects directory to grow out of control. We didn't really need to determine what this was, because all of the commits had already been pushed to the github repository. Simply recloning from there (hooray for DVCS providing free backups) created a perfectly good repository to replace the old one.

Moral of the story: If your .git directory is 20 times the size of your content, and it causes malloc/mmap failures during routine operations, something's probably wrong with your repo.


short answer:before doing git push heroku master, run git repack -a -d --window-memory=200m

why?from what I understand, git push runs git gc, which runs git repack.

the problem is that if no maximum memory size is passed, then git will take up unlimited amount of memory (aka all of the memory in your computer) when compressing..hence the out of memory error.

so before doing git push heroku master, run git repack -a -d --window-memory=200m

this will use a maximum of 200MB of memory when compressing, hence preventing the process running out of memory.

see http://linux.die.net/man/1/git-repack for more details.


Should be able to limit the packsize to 100mb and limit the thread number to 1:

$ git config --global pack.packSizeLimit "100m"$ git config --global pack.threads "1"