jpmulongo
jpmulongo

Reputation: 31

What is the solutionn to this error fatal: Out of memory, malloc failed (tried to allocate 1048576000 bytes) when pushing to heroku?

I am trying to push a repo to heroku using the following command: git push -u heroku master but I keep getting the error below:

fatal: Out of memory, malloc failed (tried to allocate 1048576000 bytes)
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (10/10), 1012 bytes | 0 bytes/s, done.
Total 10 (delta 1), reused 0 (delta 0)
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'https://git.heroku.com/sheltered-cliffs-69598.git'

the repo is barely bigger than 1MB. It's basically a simple hello-world application built with ruby so it only has config.ru, Gemfile, Gemfile.lock and hello.rb files, nothing else. What could be causing such an error and how to solve it?

Upvotes: 1

Views: 968

Answers (1)

Rajkumar Ulaganadhan
Rajkumar Ulaganadhan

Reputation: 708

Try this.

git gc --auto --prune=today --aggressive 
git repack 
git config --global http.postbuffer 524288000 
git config --global pack.windowMemory 256m

Upvotes: 2

Related Questions