From: Carsten Fuchs Date: Fri, 03 Mar 2017 21:03:16 GMT Subject: Re: git status --> Out of memory, realloc failed Message-ID: In-Reply-To: <6ba86c1a-87a9-f886-273b-7f94c30c4a95@web.de> Hi René, Am 02.03.2017 um 21:04 schrieb René Scharfe: > When I use ulimit -v with lower and lower numbers I can provoke mmap failures on > bigger pack files, but not the realloc failures that you're seeing. And your > packs should be only up to 20MB anyway (you can check that with "ls -l > .git/objects/pack/*.pack"). Yes, there are 9 of them, all about 20 MB in size. > So a shot in the dark: Do you have a lot of untracked files? You could check by > cloning your repository locally (which copies only tracked contents). Does "git > status" work on the clone? I had about 40 modified or untracked files with a combined file size of about 5 MB. Before I got your latest mail, I tried something else: Instead of connecting to the system with the repository via SSH as usual, I accessed the repository by mounting its file system via gvfs-mount onto my local desktop machine. Then I used my local, normally working Git to commit all modified and some untracked files (and deleted those that were left). Running `git status` and other commands took a very long time over a network connection of only 6 MBit/s, but eventually I got everything committed and pushed. Quite in the spirit of your above words, getting rid of untracked files helped: Logging normally via SSH into the remote machine again, `git status` ran normally. Only then did I see your mail and got another clone, where `git status` worked equally well – but then `git diff` failed in a similar manner, continuing the problems of `git status`: (uiserver):p7715773:~/__TEST__$ git clone https://CarstenF@bitbucket.org/CarstenF/website-cafu.git Cloning into 'website-cafu'... Password for 'https://CarstenF@bitbucket.org': remote: Counting objects: 44359, done. remote: Compressing objects: 100% (28777/28777), done. remote: Total 44359 (delta 19201), reused 38661 (delta 14143) Receiving objects: 100% (44359/44359), 168.28 MiB | 20.95 MiB/s, done. Resolving deltas: 100% (19201/19201), done. Checking connectivity... done. Checking out files: 100% (18524/18524), done. (uiserver):p7715773:~/__TEST__$ cd website-cafu/ (uiserver):p7715773:~/__TEST__/website-cafu$ git status On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean (uiserver):p7715773:~/__TEST__/website-cafu$ git diff fatal: unable to create threaded lstat (uiserver):p7715773:~/__TEST__/website-cafu$ git diff fatal: Out of memory, realloc failed fatal: Out of memory, realloc failed fatal: Out of memory, realloc failed fatal: recursion detected in die handler > Another one, darker yet: Does "git config core.preloadIndex 0" help? That's it! :-) Once that was set, both `git status` and `git diff` worked normally again! I cannot test `git status` right now in the same situation as before, as I no longer have a working directory that is "as dirty" as before, but the above setting seems to fix the problem promptly and thoroughly! Many thanks for your help! :-) Best regards, Carsten