Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Normally we develop in VS 2005 Pro, but I wanted to give VS 2010 a spin. We have custom build tools based off of GNU make tools that are called when creating an executable.

This is the error that I see whenever I call my external tool:

...\gnu\make.exe): *** couldn't commit memory for cygwin heap, Win32 error 487

The caveat is that it still works perfectly fine in VS2005, as well as being called straight from the command line. Also, my external tool is setup exactly the same as in VS 2005.

Is there some setting somewhere that could cause this error to be thrown?

share|improve this question
wouldn't this be better on stackoverflow? – warren Jun 15 '10 at 13:49
up vote 1 down vote accepted

From problem with heap, win32 error 487 :

Each Cygwin app gets a special heap area to hold stuff which is inherited to child processes. Eg. all file descriptor structures are stored in that heap area (called the "cygheap"). The cygheap has room for at least 4000 file descriptor structures. But - that's the clue - it's fixed size. The cygheap can't grow. It's size is reserved at the application's start and it's blocks are commited on demand.

For some reason your server application needs all the cygheap space when running under the described conditions.

A possible solution might be found in Changing Cygwin's Maximum Memory:

Cygwin's heap is extensible. However, it does start out at a fixed size and attempts to extend it may run into memory which has been previously allocated by Windows. In some cases, this problem can be solved by adding an entry in the either the HKEY_LOCAL_MACHINE (to change the limit for all users) or HKEY_CURRENT_USER (for just the current user) section of the registry.

Add the DWORD value heap_chunk_in_mb and set it to the desired memory limit in decimal MB. It is preferred to do this in Cygwin using the regtool program included in the Cygwin package. (For more information about regtool or the other Cygwin utilities, see the section called “Cygwin Utilities” or use the --help option of each util.) You should always be careful when using regtool since damaging your system registry can result in an unusable system. This example sets memory limit to 1024 MB:

regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 1024
regtool -v list /HKLM/Software/Cygwin

Exit all running Cygwin processes and restart them. Memory can be allocated up to the size of the system swap space minus any the size of any running processes. The system swap should be at least as large as the physically installed RAM and can be modified under the System category of the Control Panel.

It wouldn't hurt to ensure that the maximum size of your windows swap file is large enough.

And by the way, how much RAM do you have in your computer?

share|improve this answer
1.5gb of RAM...swap file is definitely big enough...i'll see if i can find where these settings are defined in our make process...there's no actual cygwin environment running at compile-time..its all windows exe's that are called – espais Jun 15 '10 at 14:56
@espais: You are using the cygwin make. Was this by intent? Or can you switch to Microsoft's make? – harrymc Jun 15 '10 at 16:35
nope...using the gnu tools is the department standard...what i was getting at was that all exe's are called in a non-cygwin environment (through some creative batch file scripting) – espais Jun 16 '10 at 19:58
@espais: That creative environment doesn't allocate enough heap space for the cygwin executables. For some reason the problem is more acute with VS2010 Express. You need to either fix that environment, or use another Linux port, or use Microsoft utilities. – harrymc Jun 16 '10 at 20:52
ok, thanks! i'll see what i can do – espais Jun 17 '10 at 14:00

Perhaps it is a problem with the Expressiveness versus the Professionalism of the version. You could try trying the trial of the Professional version.

share|improve this answer
That wouldn't make any sense. – SLaks Jun 9 '10 at 16:39

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.