top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

Git clone out of memory on Windows

0 votes
798 views

I am unable to clone my repository. I get a message of out of memory. The server is located on Hyper-V running on Win Server 2008 R2 SP-1
The OS is Windows 7 64BIT.

posted May 30, 2013 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

I assume c:\repo is your bare repository on the server.

Do the following:
1.) Backup the bare repository on the server to c:\repo-backup
From now on work exclusively on the backup!
2.) Check the repository for consistency
git fsck --full --strict
3.) Do manual garbage collection
git gc

Retry cloning the repository.
If that does still not work, it might be the case that delta compression on the server is tried and leads to memory exhaustion.

Do you have added large (> 100MB) files recently and already pushed to the repository?

If yes, I'd suggest to set low enough limits for the window sizes. My settings on the server side are [core]

packedGitLimit = 512m 
packedGitWindowSize = 512m 
bigFileThreshold = 256m 

[pack] 
deltaCacheSize = 256m 
windowMemory   = 256m 

which are good enough to be able to clone repositories with >1GB binary files inside. Note that my settings are for a 64-bit git on linux.

To prevent delta compression of big files on the client side beforehand use the delta flag of git attributes 1
contents of top level .gitattribute *.rar -delta

Click Here to know the answer(Hope this Link will work )

If your problem will still be there then please follow this link

answer Mar 4, 2014 by Hiteshwar Thakur
Similar Questions
+2 votes

I normally use git on linux, though I have an installation on a Windows 7 laptop.When using it yesterday to clone a repository on my linux machine, the clonewould open with one of the files modified. I could not undo the modification. Repeated cloning would do the same thing. I then tried cloning from the originalrepo, but using a linux partition on that laptop. It worked fine. Any idea why theWindows git doesn't work?

+1 vote

I wanted to avoid push if any of the files is deleted from the local git clone area. Can anyone please help me with that?

I am using Stash for repository management.

+2 votes

For weeks I have been running Windows 10 tech preview and EVERYTHING loads and runs great ... except maybe Git. When I click on the installer/loader file in explorer it causes explorer to crash. Anyone out the a Windows 10 insider, or can anyone comment on ...

+1 vote

I've been using git for some time now, and host my remote bare repositories on my shared hosting account at Dreamhost.com. As a protective feature on their shared host setup, they enact a policy that kills processes that consume too much memory. This happens to git sometimes.

By "sometimes" I mean on large repos (>~500MB), when performing operations like git gc and git fsck and, most annoyingly, when doing a clone. It seems to happen in the pack phase, but I can't be sure exactly.

I've messed around with the config options like pack.threads and pack.sizeLimit, and basically anything on the git config manpage that mentions memory. I limit all of these things to 1 or 0 or 1m when applicable, just to be sure. To be honest, I really don't know what I'm doing ;)

Oddly enough, I'm having trouble reproducing my issue with anything but git fsck. Clones were failing in the past, but after a successful git gc, everything seems to be ok(?)

Anyway, I'd like some advice on what settings limit memory usage, and exactly how to determine what the memory usage will be with certain values.

0 votes

We recently upgraded from Git 2.8 to 2.9 and saw an issue when there are multiple keys added to my ssh-agent.

I have two keys.
- KeyA (my company that has access to the repository I want to clone)
- KeyB (just my personal key with access to my personal stuff)

Having both keys in loaded and listed in ssh-add -L fails to clone the repository. I tried to change the order of the key in the agent but neither KeyA, KeyB nor KeyB, KeyA will work. The only case that works if I have KeyA loaded an no other key is added to the ssh-agent.

Having multiple Keys loaded works with Git 2.8 and Git 2.7 (I didn't try older versions)
Cloning fails with 'Unauthorized Access' of our Git provider. (It's Bitbucket in this case)

I read the Changelog for 2.9 and couldn't find any reference to changed key handling. Is there anything that I can add to the git clone command to get the old behavior?

...