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

前端 未结 9 1422
有刺的猬
有刺的猬 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:45

    I had the same issue using Ubuntu with 1G RAM and I added some swap space (1G more). It is working.

    0 讨论(0)
  • 2021-01-01 17:52

    After long hours of search and not getting the solution, in frustration I had allocated "999999999" to postbuffer and it worked wonders. ;)

    [http]
        postbuffer = 9999999999
    

    Try this it may work for you also. Good Luck. :)

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-01-01 17:58

    I fixed this by closing applications that use a lot of memory (visual studio, sql server), and pushing again

    0 讨论(0)
  • 2021-01-01 18:01

    I fixed this by decreasing the postbuffer size:

    [http]
        postbuffer = 5m
    
    0 讨论(0)
  • 2021-01-01 18:01

    I solved this by adding memory to my server which was 512MB so I extend it to 2GB

    0 讨论(0)
提交回复
热议问题