Re: Memory Limit



Code and data share the same virtual address space. Thus
you don't have 3GB virtual space for allocation - you have
a swiss cheese of available virtual addresses. Windows
DLLs are intentionally grouped towards the end of the 2GB
virtual spaceto allow larger contiguous blocks to be allcoated
by user programs . However, by large here we mean 1-1.5GB
of contiguous virtual addresses. Furthermore, there are some
pesky DLLs that interfere - some load in the 0x5xxxxxxx
range and one WinXP DLL loads at 0x20000000. You may
not necessarily be loading these though.

And please don't confuse DLLs with processes - each DLL
is loaded in the virtual address space of the host process, and
thus they fragment your virtual address space.

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@xxxxxxxx
MVP VC FAQ: http://vcfaq.mvps.org
=====================================

"mustafa" <mustafa@xxxxxxxxxxxxxxxx> wrote in message
news:90C65659-EEB3-4AD3-B523-9AA706939DC1@xxxxxxxxxxxxxxxx
Below is the memory dump of my computer with /3GB option set...
I get this information from MATLAB application...

Bo said that "I am not allocating physical memory, but allocating virtual
memory..."
Ok then, I am not interested in the 923MB free physical memory shown
below...
If I am using virtual memory and 3GB virtual memory dedicated to my single
application, why my application can not find a free block in this 3GB
virtual
memory space dedicated to my application?

Also I think that Alexander told that, it is not possible to allocate 2GB
memory because WinXP DLLs are already allocating some small pieces which
prevents to have 2GB continuous free block... If I will care about Bo's
sentences, why I need to think about physical memory, my application has
its
own 3GB virtual memory space which can not be allocated by other processes
like XPs DLLs... So this 3GB virtual memory space will be continiously
free.

Do you have really "complete single article" which is describing what we
have discussed up to now? all details of this mechanism?



Physical Memory (RAM):
In Use: 1123 MB (4632a000)
Free: 923 MB (39b51000)
Total: 2046 MB (7fe7b000)
Page File (Swap space):
In Use: 1067 MB (42b1e000)
Free: 21354 MB (536ae1000)
Total: 22421 MB (5795ff000)
Virtual Memory (Address Space):
In Use: 310 MB (13629000)
Free: 2761 MB (ac9b7000)
Total: 3071 MB (bffe0000)
Largest Contiguous Free Blocks:
1. [at 10300000] 1205 MB (4b560000)
2. [at 7ffe1000] 1023 MB (3ffc0000)
3. [at 5d36e000] 252 MB ( fc92000)
4. [at 6d857000] 66 MB ( 4249000)
5. [at 5b8b4000] 23 MB ( 17dc000)
6. [at 71c03000] 19 MB ( 13fd000)
7. [at 7a038000] 18 MB ( 12f8000)
8. [at 73026000] 18 MB ( 126a000)
9. [at 7e4a0000] 18 MB ( 1250000)
10. [at 7d49e000] 15 MB ( f72000)
======= ==========
2662 MB (a66f8000)





"Bo Persson" wrote:

mustafa wrote:
:: Thank you very much for your replies. I undestand all your
:: patience and hope you will not get angry... Here is my new
:: scenario to clearify last questions in my mind.
::
:: You have 2GB physical memory, with /3GB option set in the boot.ini.
:: You have seperate free memory blocks with 200MB, 500MB, 600MB in
:: physical memory. You try to run the following code:
::
:: void main(){
:: double Cube[512][512][512]; // equal to 1GB
:: ...
:: }
::
:: - your application will fail because there is no single free block
:: of 1 GB in the physical memory.

But you are not allocating physical memory. You are allocating virtual
memory.

Unfortunately the virtual memory is also fragmented. You run out of
contiguous virtual memory.

:: If I am dependent on the free
:: block size of the physical memory, then what is the purpose of
:: virtual memory?

You are not dependent on physical memory, you are dependent on the
possible amount of virtual memory. Unfortunately, on current 32 bit
systems they are of the same size. That VERY MUCH reduces the benefit
of using virtual memory.

On a Windows XP-64 system, with 1 GB RAM and a 20 GB swap file I have
successfully allocated 20+ GB of virtual memory in a single program.


:: Why XP allows to create 10GB page file, in which
:: case this page file is used?

It is used if you run several programs, each using a large amount of
virtual memory, like 10 programs using 1 GB each.


Bo Persson





.



Relevant Pages

  • Re: Explicit loading does not work
    ... This utility just prints virtual memory layout for the application with XIP attributes if any. ... Application DLLs can not be loaded at the address where XIP dlls reside. ... when this space is out, HeapAlloc begins allocating virtual memory from the XIP ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: Explicit loading does not work
    ... prints virtual memory layout for the application with XIP attributes if any. ... you can not use memory status WINAPI as it reports XIP memory as FREE ... Application DLLs can not be loaded at the address where XIP dlls reside. ... HeapAlloc by default begins allocating memory from the virtual space between ...
    (microsoft.public.windowsce.embedded.vc)
  • Re: J4 - presentation/discussion on "Future of the COBOL Standard"
    ... there is obviously no problem with allocating the maximum ... array size: all that's actually needed in the compiled program is a pointer ... of some sort to the virtual memory segment that it's stored in. ... compilers that actually allocate space as part of the compiled unit will run ...
    (comp.lang.cobol)
  • Re: J4 - presentation/discussion on "Future of the COBOL Standard"
    ... there is obviously no problem with allocating the maximum ... array size: all that's actually needed in the compiled program is a pointer ... of some sort to the virtual memory segment that it's stored in. ... compilers that actually allocate space as part of the compiled unit will run ...
    (comp.lang.cobol)
  • Re: Virtual memory question
    ... saying something about the virtual memory being too low. ... My paging size is ... already allocating 411 MB then I would set the initial size for at ...
    (microsoft.public.windowsxp.general)