Help! cygwin's malloc does not work

DJ Delorie dj@delorie.com
Mon Apr 17 17:20:00 GMT 2000


> Basically, it looks like cygwin can not handle large memory allocations.

Open regedit (or regedt32) and find the key
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\

Create a new DWORD value there called "heap_chunk_in_mb" that contains
the maximum amount of memory (in Mb) your application needs (watch the
hex/decimal toggle).  Exit and restart all cygwin applications.

The default is 128 (i.e. 128Mb) if no registry key is set.

Here is a more interesting "max memory" program:

main()
{
  unsigned int bit=0x40000000, sum=0;
  char *x;

  while (bit > 4096) {
    x = malloc(bit);
    if (x)
      sum += bit;
    bit >>= 1;
  }
  printf("%08x bytes (%.1fMb)\n", sum, sum/1024.0/1024.0);

  return 0;
}

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list