Re: Windows array allocation problem



glen herrmannsfeldt wrote:
Roy Lewallen wrote:
I'm getting an "insufficient virtual memory" error when trying to allocate an array to a size which is about 385 MB less than the amount of available virtual memory. I'm using the Intel Visual Fortran v. 9.1 compiler, with the compiler and program running under Windows XP.

The allocation statement is

ALLOCATE(A(N), STAT = IStat)

where A is a KIND = 4 complex array. The operation fails, with STAT = 41 (insufficient virtual memory) with N somewhere between 214,358,000 and 214,358,881.
(snip)

Your program itself and any other memory it uses also has to fit in
that space. I/O buffers, stack, and others that you don't usually
think about still count.

I understand that. But why aren't those accounted for by the GlobalMemoryStatus or GlobalMemoryStatusEx report of available virtual memory? How can I determine how much is actually available?

The OS and such should be in the other 2GB of the 4GB addressable,
but many others do still go in with your program.

As I understand Windows operation, each Windows application has its own 2 GB of addressable virtual memory space. The total virtual memory available to all running applications can add up to a great deal more than 4 GB. This is swapped to and from actual memory and the disk as needed. Normally, Windows applications don't need to be concerned how their own 2GB of address space is mapped to the system real and virtual memory, except for its potential profound effect of execution speed if swapping takes place. If this is correct, then I don't understand your statement about the "other 2GB", because each application doesn't consume 2GB of the addressable system memory.

Roy Lewallen
.



Relevant Pages

  • Re: Strange behavior - paging file wont resize.
    ... Upon logging back in I notice the paging file is still the same>> size ... it in practice so it's certainly not universal for SP2 installations, ... Virtual Memory in Windows XP ...
    (microsoft.public.windowsxp.general)
  • Re: WSUS 3 SP1 -svchost.exe remains at high memory usage on XP SP2
    ... how to query virtual memory usage? ... Windows Firewall/Internet Connection Sharing ... So, Bill, do you have an answer for my implied question about querying ...
    (microsoft.public.windowsupdate)
  • Re: Problems opening applications
    ... Let's see how much RAM memory this system has, and how much virtual memory is available. ... I might suggest you reboot the system into Safe mode, ... Another suggestion I'd offer to test in normal mode of Windows: ... Is one of the applications Internet Explorer? ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Office 2003 hangs on Menu commands
    ... response I was getting in safe mode. ... I got a "windows has recovered from a serious ... If you think I need to redo the virtual memory, ... in normal mode use your safemode ...
    (microsoft.public.office.misc)
  • Re: Page Files
    ... Windows manage the size from the get-go, ... In the bottom box where it's labeled "Virtual Memory", ... and also by what i see in Task Manager. ... double-click the tray icon there is quite some delay before WLM is ...
    (microsoft.public.windowsxp.perform_maintain)