Re: [msysGit] Git clone out of memory on Windows

1,808 views
Skip to first unread message

Konstantin Khomoutov

unread,
Jun 10, 2013, 7:14:40 AM6/10/13
to ruthy...@gmail.com, msy...@googlegroups.com
On Mon, 10 Jun 2013 01:40:40 -0700 (PDT)
ruthy...@gmail.com wrote:

> 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.
>
> What do you suggest I should do?

I would suggest doing two things:

1) Reporting your Git version at least.

2) Trying to set the pack.windowMemory configuration variable to
a non-zero value (say, "100m" or something -- refer to the
`git config` manual page for more info).

Konstantin Khomoutov

unread,
Jun 10, 2013, 8:15:02 AM6/10/13
to ruthy...@gmail.com, msy...@googlegroups.com
On Mon, 10 Jun 2013 05:02:31 -0700 (PDT)
ruthy...@gmail.com wrote:

> My local git version is
> git version 1.8.1.msysgit.1
> on the server
> git version 1.8.1.msysgit.1
>
> In the git bash I used the following:
> >> git config --global pack.windowMemory "100m"
> Still, I was unable to clone with the following error:
> POST git-upload-pack (650 bytes)
> remote: Counting objects: 45620, done.
> remote: warning: suboptimal pack - out of memory
> remote: fatal: Out of memory? mmap failed: No error
> remote: aborting due to possible repository corruption on the remote
> side.
> fatal: protocol error: bad pack header
[...]
> I appreciate your assistance.

Can this [1] help? In particular, this SO answer [2] it links to?
If this fails, I'd go through links found by querying [3].

1. http://superuser.com/a/537381/130459
2. http://stackoverflow.com/a/12808378
3. https://www.google.com/search?q="warning%3A+suboptimal+pack+-+out+of+memory"

Johannes Schindelin

unread,
Jun 10, 2013, 12:51:50 PM6/10/13
to ruthy...@gmail.com, msy...@googlegroups.com
Hi Ruthy,

On Mon, 10 Jun 2013, ruthy...@gmail.com wrote:

> In the git bash I used the following:
>
> >> git config --global pack.windowMemory "100m"

This is local.

> Still, I was unable to clone with the following error:
>
> POST git-upload-pack (650 bytes)
>
> remote: Counting objects: 45620, done.
>
> remote: warning: suboptimal pack - out of memory
>
> remote: fatal: Out of memory? mmap failed: No error

As the prefix "remote:" suggests: this is remote. Unless you have a way to
configure the remote side, you are out of luck, unfortunately.

Ciao,
Johannes

Ruthy Katz

unread,
Jun 11, 2013, 1:47:28 AM6/11/13
to msy...@googlegroups.com, ruthy...@gmail.com
Hi Johannes,
 
I do have an access to the remote server and the ability to configurate it.
On the server the repository is a bare repository.
I don't know what to do and how to configurate it...
 
If you have any suggestions they will be most welcome!
 
Thanks,
 
Ruthy

Thomas Braun

unread,
Jun 11, 2013, 10:18:32 AM6/11/13
to Ruthy Katz, msy...@googlegroups.com
Am 11.06.2013 07:47, schrieb Ruthy Katz:

Hi Ruthy,

> I do have an access to the remote server and the ability to configurate it.
> On the server the repository is a bare repository.
> I don't know what to do and how to configurate it...
> If you have any suggestions they will be most welcome!

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

I would 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

Hope that helps
Thomas

[1]: https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

Ruthy Katz

unread,
Jun 11, 2013, 10:41:26 AM6/11/13
to msy...@googlegroups.com, Ruthy Katz
Hi Thomas,
 
My server is on a virtual machine running windows 7 64bit.
Can you tell me which adjustments do I need to do or should I run these commands using git bash?
 
Thanks again,
 
Ruthy

Ruthy Katz

unread,
Jun 17, 2013, 1:56:16 AM6/17/13
to msy...@googlegroups.com
Hi Thomas,
 
Thanks for your help!
 
I perfomed what you suggested and in addition I followed the manual for cleaning the repository
and now I can clone the repository again :-)
 
Have a nice day!
 
Ruthy
On Tuesday, June 11, 2013 5:18:32 PM UTC+3, Thomas Braun wrote:
Reply all
Reply to author
Forward
0 new messages