Re: Maximum memory available in XP
From: Carl Daniel [VC++ MVP] (cpdaniel_remove_this_and_nospam_at_mvps.org.nospam)
Date: 02/16/05
- Next message: Carl Daniel [VC++ MVP]: "Re: resize image"
- Previous message: Joe: "Re: ATL-COM: return pointer to instance"
- In reply to: Jack: "Maximum memory available in XP"
- Next in thread: adebaene_at_club-internet.fr: "Re: Maximum memory available in XP"
- Reply: adebaene_at_club-internet.fr: "Re: Maximum memory available in XP"
- Messages sorted by: [ date ] [ thread ]
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
- Next message: Carl Daniel [VC++ MVP]: "Re: resize image"
- Previous message: Joe: "Re: ATL-COM: return pointer to instance"
- In reply to: Jack: "Maximum memory available in XP"
- Next in thread: adebaene_at_club-internet.fr: "Re: Maximum memory available in XP"
- Reply: adebaene_at_club-internet.fr: "Re: Maximum memory available in XP"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|