[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: "resource temporarily unavailable" errors on windows 7

From: Alex Harsanyi
Subject: Re: "resource temporarily unavailable" errors on windows 7
Date: Wed, 14 Mar 2012 13:34:42 +0800

2012/3/14 Alex Harsanyi <address@hidden>:

> Each time I start a shell process "M-x shell" (I rename the buffers,
> so I have multiple shells running), the stack reserved size grows by
> about 8Mb, the commited size by about 12K and the free memory
> decreases by 8Mb.  The Private Data commited size also changes by a
> few KB.

I checked the executable headers, and the default thread stack size is
set to 8Mb. "objdump -p emacs.exe" lists (among other things):

    SizeOfStackReserve      00800000
    SizeOfStackCommit      00001000

I also read the MSDN documentation for CreateThread and it looks like
the dwStackSize parameter represents the commit size unless the
STACK_SIZE_PARAM_IS_A_RESERVATION flag is passed to CreateThread.   I
tried adding this flag, but it was not recognized by mingw so I
replaced it with the value (0x00010000).

When I recompiled, the resulting emacs would reserve 1Mb of stack for
each new thread.  I than tried a few values for the dwStackSize
parameter and the smallest stack reservation I could obtain was 64K,
Here is the call:

   cp->thrd = CreateThread (NULL, 64 * 1024, reader_thread, cp,
0x00010000, &id);

It also seems that the reserved stack size reverts to 1Mb if
dwStackSize is too small: the folowing values for dwStackSize will
result in 1Mb being reserved:  4, 1024, 4*1024 and the following
values will cause 64K to be reserved: 8*1024, 32*1024, 64*1024.



> When I start emacs normally (reading the init files), the Free section
> has 47'224K and decreases by 8Mb for each shell process I start (Stack
> increases accordingly).
> I also noticed that spontaneously, the Stack reserved size grows by
> about 10-12Mb (Free section decreases accordingly), than the memory is
> released a few seconds later.  By spontaneous, I mean that I don't
> interact with the Emacs session, I just hit refresh on the VMMap
> application.  This happens also when I start emacs with "emacs -Q".
> Alex.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]