Memory allocation problem

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


On Mon, 10 Aug 2009 14:15:41 -0400, bearophile <bearophileHUGS at lycos.com>  
wrote:

> Steven Schveighoffer:
>> 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.
>
> I was looking for using 1.8 GB not 2.
>
>
>> Better off to not desire than to complain about edge conditions based  
>> on hardware limitations.<
>
> With C I can use up to about 1.94 GB of RAM, I don't think 1.8 is so on  
> the edge :-)
> I think this is a bug of DMD, it's not a problem of my PC.

But you are complaining about limitations for which many factors may  
contribute.  One of them is DMD.  I'm not saying there is not a bug in  
DMD, I'm just saying that expecting to be able to utilize almost all of  
your RAM for your one application in a system which runs dozens of  
services along with a GUI and other stuff is expecting too much.

BTW, you are not getting 1.94GB of RAM allocated via C, just 1.94GB of  
virtual space.  I know of no "normal" programs which try to allocate all  
available RAM and perform well.  I think this is a non-issue, or at least  
not a good test case.

If you are running XP you should know that 256MB of RAM is the *minimum*  
requirement, which means the OS probably takes up about 75% of that  
space.  Don't expect to run really fast on a system like that.  You are  
reducing your system to that state when you try to use all RAM on the  
system.

Now, if you allocated 1GB of ram and noticed that your process was using  
2GB of virtual space, I'd say that's a bug in DMD (I think someone  
reported something like that a while ago, not sure if it was fixed).

-Steve



More information about the Digitalmars-d mailing list