Windows heaps and Cygwin heap

Corinna Vinschen
Tue May 17 08:20:00 GMT 2011

On May 13 06:32, Ryan Johnson wrote:
> On 13/05/2011 5:29 AM, Corinna Vinschen wrote:
> >On May 13 10:36, Corinna Vinschen wrote:
> >>So we now know that we are actually observing a part of the ASLR
> >>strategy of NT6.  Heap addresses are always randomized.  Yes, there is a
> >>PE flag which controls ASLR on a per-executable basis, but unfortunately
> >>this only influences the usage of ASLR for the executable image itself,
> >>as well as the thread stacks.  There's no way at all to disable heap ASLR.
> >It appears that I misread.  The PE flag might not influence stack
> >randomization, but what I found in the net is contradictory.  However,
> >even if stack ASLR is always on, it seems the preferred addresses of
> >thread stacks are also in the range below 0x20000000.
> In any case, I also have never seen problems above 0x20000000.

I'm looking into the heap and stack addresses for a good amount of time
now.  Since we're talking about Cygwin applications only, which don't
use HeapCreate, we only have to care for heaps created by Win32 DLLs.

What I'm observing is that even big apps like vim, emacs, octave don't
use addresses beyond 0x03000000.  Setting the heap to an address of
0x20000000 appears to be a rather big waste of memory.

So I'm planning to drop the bar to 0x08000000, which gives the heap
a potential extra memory of 384 Megs. and still leaves a confortable
cushion of 80 Megs for the OS.

Does anybody see a good reason not to do that, like, say, different
observations of the memory address usage by OS DLLs and stuff?


Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat

More information about the Cygwin-developers mailing list