• C

Need system call that tells how much memory

NT 4.0; Visual C/C++ -----

Is there a system call that tells me how much memory is installed/available?  I'm looking for the most straight-forward, easy to use function.  I'm trying to avoid having to 'walk the heap", calculating for myself.

thx.
msaccessAsked:
Who is Participating?
 
AlexVirochovskyConnect With a Mentor Commented:
You can use GlobalMemoryStatus/GetFreeSpace functions.
0
 
msaccessAuthor Commented:
Does this require compiling with MFC or any other special libraries?  I should have mentioned that my application is a vanilla C program.  It does not and ideally will not need to link to anything other than the base C language stuff?

thx.
0
 
AlexVirochovskyCommented:
No, not must MFC or OWL. It is pure Windows API
0
 
msaccessAuthor Commented:
but it is windows, so I'll need to link in all that stuff -- which I don't want to do.  Is there a system call that is part of the base os?
0
 
AlexVirochovskyCommented:
In dos you can use coreleft()/farcoreleft() functions.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.