GIT: fatal: Out of memory, malloc failed (tried to allocate 889192448 bytes)

前端 未结 9 1440
有刺的猬
有刺的猬 2021-01-01 17:10

I have this error while pushing my project to tfs GIT.

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

9条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-01 17:53

    So what it basically requires is the free memory of 889192448 bytes (889MB Approx). This error occurs for 2 reasons

    • When your RAM is running out of space.
    • Memory limit set for Git is not meeting the requirement.

    To check the free memory on Linux based systems.

    free -h
    

    If free memory is greater than the required memory, then you don't have to do anything here, otherwise you need to add the swap memory to increase the available free space on RAM.

    If the free memory of RAM is already in place for the required memory, then you need to configure your git to utilise this. You do this with the following:

    git config pack.packSizeLimit 1g
    git config pack.deltaCacheSize 1g
    git config pack.windowMemory 1g
    git config core.packedGitLimit 1g
    git config core.packedGitWindowSize 1g
    

    Hope this helps.

提交回复
热议问题