[winapi] to check avaliable memory

Started by
2 comments, last by fir 10 years, 8 months ago

Is there a call in winapi for checking the amount of avaliable memory?

Second question, if I got build a c/winapi program which use a 700 MB

of static data/tables what with it result like when running on 500 MB

machine ?

Advertisement
You can use GlobalMemoryStatus() or GlobalMemoryStatusEx() to find out available memory.

Depending on how you allocate that memory Windows will let you do that (use more memory than is physically available).

Back in the old days of yore (Win 3.11) I could load and scroll on a 8 MB bitmap on a 4 MB machine. No, it was not particularely fluid, but it worked.

Checking the state is good, however having a forced abort is not. Even if you deem memory not sufficient, let it run (maybe with a warning).

Fruny: Ftagn! Ia! Ia! std::time_put_byname! Mglui naflftagn std::codecvt eY'ha-nthlei!,char,mbstate_t>

grreat, tnx for answers

This topic is closed to new replies.

Advertisement