Re: Memory Limit

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



"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.

.



Relevant Pages

  • Re: scf /scannow & INFO in Event Viewer
    ... Diskeeper has completed a defragmentation run on this ... Little or no fragmentation detected on this volume. ... use / free / unused memory ... total virtual memory allocated ...
    (microsoft.public.windowsxp.general)
  • Re: [Lit.] Buffer overruns
    ... > floating point support or a memory expansion option. ... had virtual memory support grafted on. ... > where the modified instruction was fetched from. ... vis-a-vis the official coporate strategic operating system TSS/360. ...
    (sci.crypt)
  • Re: Fastcode MM Challenge B&V 0.07
    ... VirtualAlloc to reserve address space the start and end address are always ... You can commit physical memory in 4kb ... The concept of "memory fragmentation" doesn't exist at the OS ...
    (borland.public.delphi.language.basm)
  • Re: virtual memory
    ... you can have virtual memory ... that software transparent swapping requires virtual memory. ... (since swapping it into physical memory is all or nothing). ...
    (comp.arch.embedded)
  • Re: Why is VS 2005 so slow?
    ... You are confusing physical memory with virtual memory. ... Note also that the number of apps you can run at the same time doesn't change. ...
    (microsoft.public.vc.mfc)