Memory detection

bearophile bearophileHUGS at lycos.com
Thu Aug 23 16:37:59 PDT 2012


Charles Hixson:

> Is it possible to detect when a program is using, say, 90% of 
> the memory that is available, so that I can take steps to 
> reduce usage?

With computers that have virtual memory this is not so easy to 
do. I think you have to use operating system-specific code to ask 
the OS about the physical available memory, about the virtual 
memory used, the rate of virtual memory swapping, and use those 
three values in some way.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list