Re: Windows array allocation problem



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
.



Relevant Pages

  • Re: Windows array allocation problem
    ... 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. ... The maximum allocation is consistently 146 MB less than the reported available virtual memory. ... So the phenomenon isn't due only to how Windows handles virtual memory but how the compiler handles it. ... 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. ...
    (comp.lang.fortran)
  • Re: Windows array allocation problem
    ... If the required size exceeds the possible size, the program has internal virtual memory management to solve the problem in pieces, storing intermediate pieces on the disk. ... much is available for an actual allocation. ... since the array dimension and the determination of whether to use the virtual memory manager are presently being determined by the calling program and passed in. ...
    (comp.lang.fortran)
  • Re: GC performance - GC fragility
    ... Though the GC heap will look like one before compaction. ... allocation sizes to different "heap blocks", but it can't be IMHO generally be prevented. ... If you only have macro-fragmentation in the virtual memory space, you can operate with limited fragmentation-induced waste in the allocated memory space. ... that's because the concurrent GC can be gotten into a cycle of never ending GC compaction if your allocation rate exceeds or equals the compaction rate, a condition easy to reach when part of your allocated pool is swapped out. ...
    (borland.public.delphi.non-technical)
  • Re: a big limit of mathematica?
    ... to the amount of virtual memory it is allocated by the operating system, and perhaps by the maximum amount of memory Mathematica declares it is going to use. ... Under Paging file size for selected drive, type a new paging file size in megabytes in the Initial size or Maximum size box, and then click Set. ... possible allocation of memory should be something other than ...
    (sci.math.symbolic)
  • Re: Windows array allocation problem
    ... By "available virtual memory" I meant the amount that's actually available for use at the moment that the array allocation is made. ... Functions that report the total amount ...
    (comp.lang.fortran)