Let me start with some context:
I had to upgrade a crucial Magento webshop to a new version. To be sure all existing code would still work after the upgrade and make some post-upgrade changes I made a Git repository from the entire Magento installation (excluding obvious content like the 4.5GB of images, ./var directory etc.), pushed it to an origin and cloned it on a dev server. Made a new branch, performed the upgrades, made code changes, committed it all to the dev branch and pushed it back to origin.
Now the time has come to upgrade the 'real' shop, meaning i have to merge the master branch on the production server with the dev branch. And then everyhing goes wrong:
git fetch
- works
git branch
says: * master
git merge origin/dev
goes horribly wrong (only output after some waiting):
fatal: Out of memory? mmap failed: Cannot allocate memory
Same goes for git checkout dev
, git rebase master origin/dev
etc.
Did some research here on stackoverflow in existing questions and spent an evening of trying suggestions, including (but not limited to):
git gc
Counting objects: 48154, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (37152/37152), done.
fatal: Out of memory, malloc failed (tried to allocate 527338875 bytes)
error: failed to run repack
and:
git repack -a -d --window-memory 10m --max-pack-size 20m
Counting objects: 48154, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (37152/37152), done.
fatal: Out of memory, malloc failed (tried to allocate 527338875 bytes)
In addition to the previous command, i also tried this (which is pretty similar).
As the link makes mention of a possible issue with 32-bit systems, perhaps it's wise to mention the specs for the three systems involved:
- 'dev' server: x86_64 Gentoo 2.6.38-hardened-r6 // 4 cores & 8GB RAM
- 'origin' server: x86_64 Gentoo 2.6.38-hardened-r6 // 2 cores & 4GB RAM
- 'live' server: x86_64 Debian 4.3.2-1.1 2.6.35.5-pv1amd64 // (VPS) 2 cores & 3GB RAM
Does anyone know how I can recover from this? Does repacking on origin work? If it does, how can I convince the production server to fetch a new copy of the repository?
Any help would be greatly appreciated!
See Question&Answers more detail:
os