git clone 出现Cannot allocate memory

今天拉取分之的时候出现以上错误,按照之前往上搜索的修改注册表无效.后来在国外一个网站上找到解决方案.

git config --add core.bigFileThreshold 4m

完美解决.

一堆鸟文,谁有兴趣可以帮忙解释一下什么意思,鸟文如下.

The error itself originates in git's sha1 object handling code, but it is hard to say what's going on exactly without say knowing what's the errno returned by mmap.

Could you run your command under strace and post here the lines around mmap failure?

EDIT: Try git config --add core.bigFileThreshold 4m (or maybe even a lesser number).

core.bigFileThreshold

    Files larger than this size are stored deflated, without attempting delta compression. Storing large files without delta compression avoids excessive memory usage, at the slight expense of increased disk usage.

    Default is 512 MiB on all platforms. This should be reasonable for most projects as source code and other text files can still be delta compressed, but larger binary media files won’t be.

    Common unit suffixes of k, m, or g are supported.

https://www.kernel.org/pub/software/scm/git/docs/git-config.html

附上问题链接:http://stackoverflow.com/questions/20652850/git-fetch-cannot-allocate-memory


你可能感兴趣的:(git clone 出现Cannot allocate memory)