git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git status --> Out of memory, realloc failed

From
Carsten Fuchs <carsten.fuchs@cafu.de>
Date
Mar 3, 2017, 21:03 UTC
Message-ID
<f0787f93-5bba-f79c-2211-1558b3886c09@cafu.de>
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

Previous: René Scharfe
Message 7 of 7 in “git status --> Out of memory, realloc failed”
  1. Carsten FuchsFeb 25, 2017
  2. René ScharfeMar 1, 2017
  3. Carsten FuchsMar 1, 2017
  4. Duy NguyenMar 2, 2017
  5. Carsten FuchsMar 3, 2017
  6. René ScharfeMar 2, 2017
  7. Carsten FuchsMar 3, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.