delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2003/02/04/04:30:57

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-ID: <3E3F8857.4080508@gamma-rs.ch>
Date: Tue, 04 Feb 2003 10:31:03 +0100
From: Charles Werner <cw AT gamma-rs DOT ch>
User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2.1) Gecko/20021130
X-Accept-Language: en-us, de-ch
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re Document heap chunk in mb

Here is what I have written as a possible contribution for the Users 
Guide concerning
adjusting the Cygwin memory limit:

Cygwin comes with a maximum program size (program+data) of  384 MB. This 
means that by default no program can allocate more than this. To run 
using more real or virtual memory in your machine you must add a entry 
in the Cygwin HKEY_CURRENT_USER section of the  registry.  Add the DWORD 
value heap_chunk_in_mb and set it to desired memory limit in decimal  
MB  using the regtool program included in the Cygwin cygutils package. 
 In this example the limit is set to 1024 MB:

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

Exit all running Cygwin processes and restart them.  Memory can be 
allocated up to the size of the system swap space minus any the size of 
any running processes.  The system swap should be at least as large as 
the physically installed RAM and can be modified under the System 
category in the Control Panel accessible through the Settings tag of the 
Win32 Start menu.

A program written by DJ Delorie tests the memory allocation limit on 
your system:

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;
}

compile using 

gcc max_memory.c -o max_memory

Run the program and you will see the maximum memory that can be allocated. 



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

Tel: +41 31 951 70 05
FAX: +41 31 951 70 08
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/

- Raw text -


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