fatal: Out of memory, calloc failed

1,746 views
Skip to first unread message

McKay Salisbury

unread,
Mar 5, 2013, 12:25:42 PM3/5/13
to msy...@googlegroups.com
I'm using Visual Studio mostly.
 
I committed my local changes, and then did a pull. There were merge conflicts. When I try using Visual Studio to do the merge, it eventually asked me to "Accept Merged Result", then asks me about line normalization, then it gave an error "value was either too large or too small for an int32" in a dialog box.
 
so I broke down to the command line, and a "git merge" gives me an error "fatal: Out of memory, calloc failed"
 
and now I'm in a pretty broken state. things like "git reset --hard HEAD~1" also give me "fatal: Out of memory, calloc failed"
 
What do I do? What's wrong?
 
The source is pretty small. I've also got like 28gb unused ram, and the whole source tree is well under a gig.

Johannes Sixt

unread,
Mar 5, 2013, 2:51:40 PM3/5/13
to McKay Salisbury, msy...@googlegroups.com
Am 05.03.2013 18:25, schrieb McKay Salisbury:
> I'm using Visual Studio mostly.
>
> I committed my local changes, and then did a pull. There were merge
> conflicts. When I try using Visual Studio to do the merge, it eventually
> asked me to "Accept Merged Result", then asks me about line
> normalization, then it gave an error "value was either too large or too
> small for an int32" in a dialog box.

Don't know what this means. This is not from this planet. ;-)

> so I broke down to the command line, and a "git merge" gives me an error
> "fatal: Out of memory, calloc failed"
>
> and now I'm in a pretty broken state. things like "git reset --hard
> HEAD~1" also give me "fatal: Out of memory, calloc failed"
>
> What do I do? What's wrong?

Hard to tell. My guess is that the index file was broken somehow. Does
'git fsck' notice any oddities?

Since you are prepared to overwrite the worktree ('reset --hard') we
have some freedom in what to do next. Rename .git\index (do not remove
the file, it may be worth having for debugging). Does 'git reset --hard
HEAD~' work now?

-- Hannes

Erik Faye-Lund

unread,
Mar 5, 2013, 3:01:38 PM3/5/13
to Johannes Sixt, McKay Salisbury, msy...@googlegroups.com
On Tue, Mar 5, 2013 at 8:51 PM, Johannes Sixt <j...@kdbg.org> wrote:
> Am 05.03.2013 18:25, schrieb McKay Salisbury:
>> I'm using Visual Studio mostly.
>>
>> I committed my local changes, and then did a pull. There were merge
>> conflicts. When I try using Visual Studio to do the merge, it eventually
>> asked me to "Accept Merged Result", then asks me about line
>> normalization, then it gave an error "value was either too large or too
>> small for an int32" in a dialog box.
>
> Don't know what this means. This is not from this planet. ;-)
>

My guess is that it's from the new and shiny Visual Studio support for
Git. Yes, apparently they added Git support :)

McKay Salisbury

unread,
Mar 5, 2013, 3:04:23 PM3/5/13
to kusm...@gmail.com, msy...@googlegroups.com
Yes that's correct. I'm using it in Visual Studio. It's currently in CTP. And apparently msysgit is the client they use underneath the covers?

McKay Salisbury
©2012

Peter Harris

unread,
Mar 5, 2013, 3:21:19 PM3/5/13
to McKay Salisbury, Erik Faye-Lund, msysGit
On Tue, Mar 5, 2013 at 3:04 PM, McKay Salisbury wrote:
> Yes that's correct. I'm using it in Visual Studio. It's currently in CTP.
> And apparently msysgit is the client they use underneath the covers?

I haven't installed it yet, but from what I've read[1] the VS Git
plugin uses libgit2, not msysgit.

Peter Harris

[1] For example,
http://www.hanselman.com/blog/GitSupportForVisualStudioGitTFSAndVSPutIntoContext.aspx
or http://arstechnica.com/information-technology/2013/01/microsoft-embraces-git-with-new-tfs-support-visual-studio-integration/

McKay Salisbury

unread,
Mar 5, 2013, 3:29:19 PM3/5/13
to Peter Harris, Erik Faye-Lund, msysGit
That might be true, but when I do a
C:\Test\Bridge>git version
git version 1.8.0.msysgit.0

McKay Salisbury
©2012

Johannes Schindelin

unread,
Mar 5, 2013, 3:34:53 PM3/5/13
to McKay Salisbury, kusm...@gmail.com, msy...@googlegroups.com
Hi McKay,

On Tue, 5 Mar 2013, McKay Salisbury wrote:

> Yes that's correct. I'm using it in Visual Studio. It's currently in
> CTP. And apparently msysgit is the client they use underneath the
> covers?

Nope, it uses libgit2.

> McKay Salisbury
> ᅵ2012

Now it is copyright 2013, Johannes Schindelin, and I do not even grant you
the license to read it, let alone retain memory traces about it.

mriez...@gmail.com

unread,
Apr 10, 2014, 8:30:24 AM4/10/14
to msy...@googlegroups.com, McKay Salisbury
I ran into exact the same problem yesterday and finally resolved it by:
  1. Did a normal reset of HEAD (without --hard, thus not updating the working folder)
  2. An checkout -f of master to force update the working folder
This fixed the problem for me.

- Manuel

Op dinsdag 5 maart 2013 20:51:40 UTC+1 schreef Johannes Sixt:
Reply all
Reply to author
Forward
0 new messages