Re: Windows array allocation problem
- From: Roy Lewallen <w7el@xxxxxxxxx>
- Date: Sun, 30 Sep 2007 03:03:02 -0700
Dan Nagle wrote:
Hello,
Roy Lewallen wrote:Dan Nagle wrote:
IIRC, Windows marks 250 MB at one end, and 100 MB at the other,
as unusable, in order to catch stray C pointers.
Unfortunately, I can't find any reference to this on the web. I've found that the top and bottom 64 kB are reserved, but no mention of larger amounts. Can you point me to a reference where this is explained or discussed?
I seem to have filed my Windows programming books
under "I don't ever want to read these again" so I can't find
the exact reference.
ISTR that it was in the Microsoft Press book about
programming Windows system calls. I used it years ago to help
with the fthreads module. Title was something
like _Advanced Windows Programming_ or close. Also,
it was the edition for WinNT 4 or so.
Sorry not to be more specific.
Thanks, but there must be something wrong with the recollection.
I've just written a program which does nothing except call GlobalMemoryStatus to get the available virtual memory, then allocates an array to that size and in decreasing steps until STAT returns zero. It then checks the available virtual memory immediately after the allocation. The maximum allocation is consistently 146 MB less than the reported available virtual memory. Compiling exactly the same program with Compaq Visual Fortran 6.6 results in allocation to within 55 MB of the reported virtual memory. In both cases, the sum of the array size and the available virtual memory after the allocation exactly equals the available virtual memory before the allocation.
So the phenomenon isn't due only to how Windows handles virtual memory (strictly, I guess, application virtual address space) but how the compiler handles it.
The program won't attempt to allocate near the 2 GB limit unless the machine has a very large amount of RAM, to avoid swapping into and out of system virtual memory. Not too many users have that much, but no problem had been encountered until recently with the present method of determining how much could be allocated. I now see why the problem has just shown up -- I changed from the Compaq compiler to the Intel compiler not long ago. The test shows that even for the simplest program, the Intel compiler doesn't allow allocating as much of the application virtual memory as the Compaq compiler does, at least not to one large array.
Roy Lewallen
.
- Follow-Ups:
- Re: Windows array allocation problem
- From: glen herrmannsfeldt
- Re: Windows array allocation problem
- From: Steve Lionel
- Re: Windows array allocation problem
- References:
- Windows array allocation problem
- From: Roy Lewallen
- Re: Windows array allocation problem
- From: James Van Buskirk
- Re: Windows array allocation problem
- From: Steve Lionel
- Re: Windows array allocation problem
- From: Roy Lewallen
- Re: Windows array allocation problem
- From: Dan Nagle
- Re: Windows array allocation problem
- From: Roy Lewallen
- Re: Windows array allocation problem
- From: Dan Nagle
- Windows array allocation problem
- Prev by Date: Re: How to plot bi-nodal curve in the fortran language
- Next by Date: Re: gfortran, g95, and dual-core
- Previous by thread: Re: Windows array allocation problem
- Next by thread: Re: Windows array allocation problem
- Index(es):
Relevant Pages
|