This is the mail archive of the mailing list for the Cygwin project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fixing heap_chunk_in_mb to 512MB doesn't work

Re: Cygwin memory limit

Recently I wanted to increase the program/data memory limit for cygwin beyond the default 256 MB
and a quick scan of the cygwin list revealed this thread. I was able to get this to work by doing the

1. modify the registry, adding a DWORD value heap_chunk_in_mb and setting it to 1024
using the regtool that is part of the cygtools package in cygwin. The value here is in decimal Mbytes:

regtool -i set /HKCU/Software/Cygnus\ Solutions/Cygwin/heap_chunk_in_mb 1024
regtool -v list /HKCU/Software/Cygnus\ Solutions/Cygwin

2. rebooting the machine
3. turning off the inetd service (if you have installed the cygwin inetd service)
4. restarting the inetd service
5. open a cygwin bash shell window.

I tested the memory allocation using the following little C program, compiled with:

gcc -O max_mem.c -o max_mem.exe

#include "stdlib.h"
#include "stdio.h"

int main(int argc, char **argv)
char *m;
int mb;
size_t n;

if(argc < 2) {
printf("usage: %s <Mb>\n\n",argv[0]) ;
printf("input parameters: \n");
printf(" MB number of MB of memory to allocate\n"); exit(-1);
m = malloc((size_t)n*1024*1024);
if(m == NULL){fprintf(stderr,"cannot allocate memory %d MB of memory\n",n); exit(-1);}
else printf("allocated %d MB of memory\n",n);

My system is an NT4 SP5 machine running the latest cygwin dll version 1.3.12. I also tried this on a win2K SP2 system


Dr. Charles L. Werner
Gamma Remote Sensing AG
Thunstrasse 130
CH-3074 Muri b. Bern, Switzerland

Unsubscribe info:
Bug reporting:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]