Re: Maximum memory available in XP

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Carl Daniel [VC++ MVP] (cpdaniel_remove_this_and_nospam_at_mvps.org.nospam)
Date: 02/16/05


Date: Wed, 16 Feb 2005 06:54:06 -0800

Jack wrote:
> Hi,
>
> My XP computer has 3.5 GB RAM. How much memory can take at
> maximum a C program of mine written with VC++ 6.0? I mean,
> when I write "malloc (N)", how big is the maximum N (bytes)
> ? Or equivalent: I declare "double *p". What is the maximum
> number of elements of "p"?

If you boot with /3GB (option in boot.ini), you might be able to get as much
as 2GB in a single allocation but ~1.7GB is more likely (based on posts
I've seen).

There's no simple answer since it depends on virtual memory fragmentation
which is itself a function of which DLLs you load (and in what order!), what
other memory your program allocates, how many threads you have (and when
they started!), etc.

Generally speaking, to use the maximum amount of memory your program will
need to allocate several smaller buffers and manage them rather than trying
to allocate a single contiguous chunk.

-cd



Relevant Pages

  • Re: Is there a maximum contiguous memory allocation?
    ... but could ALLOCATE it! ... allocate it if I had 2GB of physical memory! ... the amount of physical memory I have installed. ... Note that you can use raw VirtualAlloc to improve your ...
    (microsoft.public.vc.mfc)
  • Re: The Lisp Curse
    ... Memory is allocated and free'd behinds the scenes in C ... But that calls malloc or libc, ... Most C file I/O functions allocate space from a storage device, ...
    (comp.lang.forth)
  • Re: experienced opinions
    ... think a multiple process model is ... Every time a threaded process allocates memory or allocate a file ... If multiple processes map shared memory or shared files, ...
    (comp.unix.programmer)
  • Re: XPC-target, s function problem
    ... You haven't said how you're allocating the memory for the matrices ... allocate all of the arrays from the heap using malloc. ... In trying to run an S function on xPC target built using the S function ... that with offline simulation everything works perfectly with bigger ...
    (comp.soft-sys.matlab)
  • Tru64 issues with Infinite limits
    ... An automated test in my nightly build was failing due to Out of Memory ... Cannot allocate block 146 ...
    (comp.unix.tru64)