title: Error installing gem: Couldn't reserve space for cygwin's heap, Win32 error 487
body: <p>I'm trying to install <code>win32-api</code> gem on my machine and I'm facing some issues when building native extensions:</p>
  
  <pre><code>$ gem install win32-api --no-ri --rdoc
  Temporarily enhancing PATH to include DevKit...
  Building native extensions.  This could take a while...
  C:\Programs\dev_kit\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
  ERROR:  Error installing win32-api:
          ERROR: Failed to build gem native extension.
  
          c:/Programs/ruby/bin/ruby.exe extconf.rb
  checking for strncpy_s()... no
  creating Makefile
  
  make
        0 [main] us 0 init_cheap: VirtualAlloc pointer is null, Win32 error 487
  AllocationBase 0x0, BaseAddress 0x60E90000, RegionSize 0x170000, State 0x10000
  C:\Programs\dev_kit\bin\make.exe: *** Couldn't reserve space for cygwin's heap, Win32 error 0
  </code></pre>
  
  <p>This problem happens when installing any gem that tries to compile a native extension, like json or win32-api, for instance.</p>
  
  <p>I already tried to change the size of virtual memory of this machine, but it didn't work. </p>
  
  <p>My configuration:</p>
  
  <ul>
  <li>Ruby version: 1.8.7p371</li>
  <li>Gem version: 1.8.24</li>
  <li>Bash 3.1.0</li>
  <li>DevKit 4.5.2</li>
  <li>Windows 7 x64</li>
  </ul>