Re: Memory Limit
- From: "Scott McPhillips [MVP]" <org-dot-mvps-at-scottmcp>
- Date: Wed, 22 Aug 2007 12:57:58 -0400
"mustafa" <mustafa@xxxxxxxxxxxxxxxx> wrote in message news:842B1F58-BCB6-4AEF-9FF1-B77B0C0606B2@xxxxxxxxxxxxxxxx
3) What I really wonder is, when I need 2GB memory block, in a computer with
2GB physical memory, why WinXP gives out of memory error instead of using
the virtual memory? So as in my previous post why I can not create a memory
block with the following decleration:
Cube = new double[600][600][600];
If there is a virtual memory, and if there is no single large enough memory
block on the physical memory, why OS dont create a space by using virtual
memory...
What virtual memory accomplishes is that your program, and every other running program, can have 2 GB (optionally, 3 GB) of address space. The OS does create the space by using virtual memory.
But the address space is always fragmented and is very unlikely to have a contiguous 1 GB area available. The OS cannot fix fragmentation. What you can do: (1) Make your allocation when the program starts. There is less fragmentation at that time. (2) Make your allocation in multiple smaller parts. (3) Use a file instead of virtual memory. Map a (smaller) portion of the file into the address space.
.
- References:
- Re: Memory Limit
- From: Nathan Mates
- Re: Memory Limit
- From: mustafa
- Re: Memory Limit
- From: mustafa
- Re: Memory Limit
- From: Bo Persson
- Re: Memory Limit
- From: mustafa
- Re: Memory Limit
- Prev by Date: Re: fopen and wfopen
- Next by Date: Re: Memory Limit
- Previous by thread: Re: Memory Limit
- Next by thread: Re: Memory Limit
- Index(es):
Relevant Pages
|