Memory allocation problem

Steven Schveighoffer schveiguy at yahoo.com
Mon Aug 10 11:10:19 PDT 2009


On Sun, 09 Aug 2009 15:51:46 -0400, bearophile <bearophileHUGS at lycos.com>  
wrote:

> grauzone:
>> Then what is there to complain?<
>
> I have paid for 2 GB RAM, so I am allowed to desire a 1800 MB array :-)

hehe.  Not necessarily.

There are often hardware/OS limitations.  For example, many 32-bit Intel  
chipsets support 4GB of memory but only allow you to use 3GB because 1GB  
of *address space* is used for PCI registers.  What ends up happening is  
you waste 1GB of memory.  However, it's advantageous to use 4GB instead of  
3GB because of the memory parity -- each channel should have the same  
amount of memory.  I worked for a company that built such systems for some  
customers.  It was a pain because we wanted to ensure all the memory was  
tested, but there was no way to physically test it...

In other cases, there may be video hardware that shares memory with your  
OS, leaving you less available space.

My point is, don't count on having 2GB of usable space even if you  
physically have 2GB of RAM, it may not be the case.  Better off to not  
desire than to complain about edge conditions based on hardware  
limitations.  It's like complaining that your car doesn't work properly at  
150Mph even though the spedometer goes that high.

-Steve



More information about the Digitalmars-d mailing list