This is the mail archive of the cygwin 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]

Re: heap_chunk_in_mb not working? Windows Server 2012

On Jul  8 06:54, Frank Seide wrote:
> Hi, I am not able to enlarge the memory size from the 256 MB default.

The default heap is 384 Megs.

> Specifically, a perl script fails after allocating 256 MB (I get is a
> message "Out of memory!" when running /bin/perl.exe; in Task Manager,
> perl.exe had just grown its private working set to 266,xxx).

The working set doesn't tell you safely about the virtual memory a
process already takes.

Does it try to allocate 256 Megs in a single block?  There are multiple
reasons that this may fail, one is that the VM is fragmented so that
there's no 256Megs block available, another is a too small pagefile.

> I tried the following two commands, to no avail. None of the tips I found on the FAQ or mailing lists (=basically these two) worked.
> % regtool -i set /HKLM/Software/Cygwin/heap_chunk_in_mb 2000

This is an old method and doesn't work anymore.

> % peflags --cygwin-heap=2000 /bin/perl.exe  
> % peflags --cygwin-heap /bin/perl.exe
> /bin/perl.exe: initial Cygwin heap size: 2000 (0x7d0) MB

This is the right method, but did you really think about it?  2 Gigs is
what a 32 bit process usually(*) gets as its *entire* virtual memory,
including the image itself, all loaded DLLs, all thread stacks, all
shared memory etc.

(*) Unless you're on a 64 bit machine, in which case you get 4 Gigs VM
    per process if the executable has the large-address awareness bit
    set (see peflags).

> I am running on a x64 Windows Server 20*12*. Could that be a problem?



Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

Problem reports:
Unsubscribe info:

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