Re: Windows array allocation problem
- From: Roy Lewallen <w7el@xxxxxxxxx>
- Date: Sat, 29 Sep 2007 13:47:58 -0700
This has been an interesting discussion, but unfortunately, I haven't seen an answer to either of my two questions, which were:
1. Why can't I allocate an array to a size much closer to the amount of available virtual memory? I realize, of course, that I have to allow for other memory use by the program in deciding the maximum I can safely allocate, but that's not the issue here.
2. If I won't be able to allocate nearly all the available virtual memory, how can I determine in advance how much I *can* safely allocate?
It appears that some people have taken "available virtual memory" to mean the entire 2GB which is allotted to the application, and have explained that the entire amount can't be used. I understand that, but that's not what I meant. By "available virtual memory" I meant the amount that's actually available for use at the moment that the array allocation is made. This would mean the original 2GB less whatever has already been used by the program, stack, other allocations, and so forth. My program has provision for approximately predicting the additional memory which will be used later in the program, and adjusts the allocation accordingly. But it needs to know how much it has altogether to work with. GlobalMemoryStatus(Ex) reports a "total virtual memory" (2GB) and "available virtual memory" (less than 2GB). I had assumed that the "available virtual memory" was the amount currently available for such purposes as array allocation. It seems that it isn't. Either it's reporting something other than the amount actually available for use, or an array can't be allocated to any larger than about 385 MB (in this case) less than the amount actually available for use. I'd like to know which is the case. More importantly, I need to know how to determine how much virtual memory space is actually available for the allocation of arrays.
I appreciate all the comments!
Roy Lewallen
.
- Follow-Ups:
- Re: Windows array allocation problem
- From: glen herrmannsfeldt
- Re: Windows array allocation problem
- References:
- Windows array allocation problem
- From: Roy Lewallen
- Windows array allocation problem
- Prev by Date: Re: gfortran, g95, and dual-core
- 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
|