Solved

Need system call that tells how much memory

Posted on 1999-01-04
5
186 Views
Last Modified: 2010-04-15
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.
0
Comment
Question by:msaccess
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
AlexVirochovsky earned 50 total points
ID: 1255550
You can use GlobalMemoryStatus/GetFreeSpace functions.
0
 

Author Comment

by:msaccess
ID: 1255551
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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1255552
No, not must MFC or OWL. It is pure Windows API
0
 

Author Comment

by:msaccess
ID: 1255553
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
 
LVL 14

Expert Comment

by:AlexVirochovsky
ID: 1255554
In dos you can use coreleft()/farcoreleft() functions.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
The goal of this video is to provide viewers with basic examples to understand how to use strings and some functions related to them in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now