delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2010/04/27/15:32:56

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=2.3 required=5.0 tests=BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,T_RP_MATCHES_RCVD,T_TO_NO_BRKTS_FREEMAIL,UNPARSEABLE_RELAY
X-Spam-Check-By: sourceware.org
X-Yahoo-SMTP: DF9INoyswBDT8O6W.pKjvSST2iQ-
Message-ID: <4BD73BD7.4070202@yahoo.com>
Date: Tue, 27 Apr 2010 12:32:39 -0700
From: Rob Donovan <hikerman2005-542731 AT yahoo DOT com>
User-Agent: Thunderbird 2.0.0.24 (Windows/20100228)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Cygwin Maximum Memory Documentation
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

I've found the following to be true on my system and feel these details 
could usefully be added to the Changing Cygwin's Maximum Memory page in 
the User's Guide.  My system is a Dell Inspiron 1520 laptop with 4GB of 
physical RAM running Windows XP Home Edition with SP3.  Uname -v reports 
the Cygwin Kernel version as 2010-04-07 11:02   Some of these comments 
are specific to XP; I gather Vista does not use a boot.ini file, for 
example.  Perhaps others running other operating systems could flesh it 
out to provide complete documentation across operating systems.

1) When changing the maximum memory available to Cygwin using "regtool 
-i set /HKLM/Software/Cygwin/heap_chunk_in_mb MMMM" the maximum useful 
value of MMMM is 4095.  Values of 4096 and above result in the heap size 
reverting to its unset value (about 1000 on my system).

2) With this change in place processes are still limited to 2GB of 
memory on 32-bit Windows systems, unless you set the /3GB switch in your 
boot.ini file.  This switch allows each process to grow to 3GB.  
However, used alone it may have undesirable consequences (such as your 
system hanging) which the /Userva=MMMM flag may prevent.  MMMM from 2900 
to 3030 is recommended.  This switch caps user processes at MMMM MB.

The change might be from a boot.ini file of

[boot loader]
;timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home 
Edition" /noexecute=optin /fastdetect

to

[boot loader]
;timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home 
Edition" /noexecute=optin /fastdetect
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home 
Edition 2.83GB" /3GB /Userva=2900 /noexecute=optin /fastdetect

You should then get a choice between OS configurations at boot.  If you 
use a 3rd party boot loader you may have to make the configuration 
changes there instead of directly to the boot.ini file.

3) With both these changes in place your process will STILL be limited 
to 2GB process size, unless you compile it with the /LARGEADDRESSAWARE 
linker flag in place.  Under gcc this flag is specified thus : gcc 
-Wl,--large-address-aware -o program.x program.c    That's W ell, not W one.


With all these changes in place I can now run gcc compiled Cygwin 
processes up to 2.83GB in size :)

/rob


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019