Couldn't reserve space for cygwin's heap

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible



After pushing to Stash results in the following intermittent error on Git clients:

H:\> git push
Counting objects: 10, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (7/7), done.
Writing objects: 100% (10/10), 1.31 KiB | 0 bytes/s, done.
Total 10 (delta 4), reused 0 (delta 0)
remote: 0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
remote: AllocationBase 0x0, BaseAddress 0x68570000, RegionSize 0x300000, State 0x10000
remote: D:\Sysdata\Git\bin\env.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
To ssh://
! [remote rejected] project/composer_nov_2015/dev -> project/composer_nov_2015/dev (pre-receive hook declined)
error: failed to push some refs to 'ssh://'


The full explanation for such issue can be found on this Stackoverflow answer.

It's Cygwin code failing to allocate a ~5 MB large chunk of memory for its heap at this fixed address 0x68570000, while only a hole ~2.5 MB large was apparently available there. The relevant code can be seen in msysgit source.


Both current Cygwin and the new version of MSYS - MSYS2 - already have different logic in place, which is hopefully more robust. It's only old versions of Git for Windows which have been still built using the old broken MSYS system.


  • Install Git for Windows 2 - it is built with the new, properly maintained MSYS2 and also has many new features, plenty of bug fixes and so on. There is also a 64-bit version available which would lower the chance of address space clashes considerably even if this problem was not fixed.
  • On our Supported Platforms we outline the Git versions that should work well with your environment.
Last modified on Feb 26, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.