2

trying to clone a big repository, I got:

remote: fatal: Out of memory, malloc failed (tried to allocate 190135255 bytes)

Saw that there is a possible configuration into ~/.gitconfig or .git/config in the client, but as it seems to be the server which is enable to generate such a big file before passing it where can I configure the size of max malloc on the server?

My system's server is

pi@domP3: ~$ git --version
git version 2.11.0
pi@domP3: ~$ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description:    Raspbian GNU/Linux 9.4 (stretch)
Release:        9.4
Codename:       stretch
Pipo
  • 4,653
  • 38
  • 47

2 Answers2

2

where can I configure the size of max malloc on the server?

Well, there is no magic in git; if you use git (probably over ssh) then the rule is pretty simple: there is

  • a repository at the server side
  • a local to the repository .git/config
  • a global ~/.gitconfig
  • a system /etc/gitconfig.

The simplest (IMO) way to edit a config is to login to the server, cd to the repository and run git config to edit local config or git config --global to edit global config.

PS. The question is — if it's just Pi do you have enough virtual memory to increase malloc size in config?

Pipo
  • 4,653
  • 38
  • 47
phd
  • 82,685
  • 13
  • 120
  • 165
  • Pi Memory: Have a swap file to make that possible yes, but your question is adecuate – Pipo Dec 14 '18 at 15:10
  • which configuration do I have to add|set? – Pipo Dec 14 '18 at 15:38
  • Something like [this](https://stackoverflow.com/a/26542281/7976758) or [that](https://stackoverflow.com/a/43934281/7976758). Found in https://stackoverflow.com/search?q=%5Bgit%5D+clone+remote%3A+fatal%3A+Out+of+memory – phd Dec 14 '18 at 15:47
  • 1
    @Pipo: 190135255 = 181 MB, not 22 MB. – torek Dec 14 '18 at 16:07
  • i figured it out ;-) can't edit my comment :-( as bytes where written with lowercase.... TLDR interpreted as bits first – Pipo Dec 14 '18 at 16:08
0

Working config for me was following on my bare repo:

/mnt/seagate_2_5i/gitRepo/documents.git/config


[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
        packedGitWindowSize = 512m
[pack]
        windowMemory = 512m
[http]
        postBuffer = 512m
Pipo
  • 4,653
  • 38
  • 47