Maximum Virtual Memory Question

Maximum Virtual Memory Question

Post by yuval.stei » Fri, 04 Apr 2008 13:59:26


Hello,
What is the maximum Virtual Memory size of a 32bit process (executable
compiled in 32bit) that runs on a Windows XP 64bit on an Intel CPU?

And if my process exceeds this size, what is the expected result?
Process crashes?

Thank you
 
 
 

Maximum Virtual Memory Question

Post by archmag » Sat, 05 Apr 2008 03:46:26


I believe it is 2gb, since that's the usual Win32 kernel/userspace split; if
your process exceeds that size, how it fails will depend on how it's
written. Failure to allocate memory/heap space shouldn't cause a crash in a
well-written application, but not all applications are well-written.

In the case of Java VMs, for example, if you set the total max heap space
too large, it will typically just refuse to start.

--
Nate Edel http://www.yqcomputer.com/
preferred email |
is "nate" at the | "I do have a cause, though. It is obscenity.
posting domain | I'm for it." - prologue to " *** " by Tom Lehrer

 
 
 

Maximum Virtual Memory Question

Post by jgd » Sat, 05 Apr 2008 04:49:00

In article
< XXXX@XXXXX.COM >,



About 3.9GB. This is more than you can get on a 32-bit Windows, because
the hardware devices - such as the video memory - are not memory-mapped
into the 32-bit address spaces. You have to link with /LARGEADDRESSAWARE
to be allowed to use more than the bottom 2GB. Note that you will not
have 3.9GB of contiguous address space, since various system DLLs sit
just below the 2GB line.

Do not try this without at least 4GB of real memory, because once it
starts swapping, things will slow down dramatically.


When the process tries to allocate more memory than it can have, it gets
the appropriate out-of-memory error, just as it would with s smaller
usable address space. What happens then is up to the process: sadly,
there's a lot of code out there that ignores the possibility of not
getting the memory it asks for. C++ makes this approach particularly
attractive to the lazy programmer.

BTW, this is really a Windows question: there's nothing Intel-specific
about the answer.

--
John Dallman XXXX@XXXXX.COM
"C++ - the FORTRAN of the early 21st century."
 
 
 

Maximum Virtual Memory Question

Post by Yousuf Kha » Sat, 05 Apr 2008 14:08:49


If your 32-bit application is PAE-aware, otherwise known as the "large
memory model" then it will see 3GB under a 32-bit Windows, but very
nearly 4GB in a 64-bit Windows. So your 32-bit apps should run just a
little bit better under a 64-bit OS.

Yousuf Khan
 
 
 

Maximum Virtual Memory Question

Post by Yousuf Kha » Sat, 05 Apr 2008 14:12:40


Interesting, but in a 64-bit OS, aren't most of the 32-bit DLLs simply
very small stubs for a 32-bit-to-64-bit thunking system? Surely such
small stubs can relocated higher up in memory?

Yousuf Khan
 
 
 

Maximum Virtual Memory Question

Post by jgd » Wed, 09 Apr 2008 05:07:00

In article <47f5b8c7$ XXXX@XXXXX.COM >, XXXX@XXXXX.COM (Yousuf Khan)



Some may well be. MSVCRxx.DLL remains 32-bit, and it loads just below
the 2GB line. And that's enough to spoil contiguous memory.

--
John Dallman XXXX@XXXXX.COM
"C++ - the FORTRAN of the early 21st century."