This is the mail archive of the
cygwin@cygwin.com
mailing list for the Cygwin project.
fixing heap_chunk_in_mb to 512MB doesn't work
- From: Charles Werner <cw at gamma-rs dot ch>
- To: cygwin at cygwin dot com
- Date: Fri, 06 Sep 2002 15:03:48 +0200
- Subject: 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
following:
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);
}
sscanf(argv[1],"%d",&n);
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);
free(m);
return(0);
}
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
sucessfully.
Cheers,
Charles
--
Dr. Charles L. Werner
Gamma Remote Sensing AG
Thunstrasse 130
CH-3074 Muri b. Bern, Switzerland
http://www.gamma-rs.ch
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/