Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Message-ID: <3D78A7B4.80802@gamma-rs.ch> Date: Fri, 06 Sep 2002 15:03:48 +0200 From: Charles Werner User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.1) Gecko/20020826 X-Accept-Language: en-us, de-ch MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: fixing heap_chunk_in_mb to 512MB doesn't work Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 \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/