Help-Quick answer to quick memory query 
Author Message
 Help-Quick answer to quick memory query

Does anyone know of a C/C++ function that when called from
inside a win32 application, returns the amount of memory that
is currently being used by that application.

I would like to produce the kind of memory readouts present on
the task manager process tab of the task manager.

Im using Visual C/C++ on an NT4.0 workstation machine.

Any help woudl be greatly appriciated, thanks.

Rich M

--
-------------------------------------------------
Richard Martin              ACT Financial Systems


-------------------------------------------------



Sat, 29 Jul 2000 03:00:00 GMT  
 Help-Quick answer to quick memory query


net.com says...

Quote:
> Does anyone know of a C/C++ function that when called from
> inside a win32 application, returns the amount of memory that
> is currently being used by that application.

GetProcessHeaps will tell you how much dynamic memory you're using.  
You can figure the static memory from the map file when you link your
app, and you can get a fairly accurate picture of stack usage by
comparing the address of a variable local to main() to the address of
a variable local to your memory usage function.  (This may be off by a
few bytes depending on what variables precede/follow each one, but
that's rarely relevant; you're typically interested in kilobytes, and
a 6 or 8 byte error doesn't matter much...)

--
    Later,
    Jerry.

The Universe is a figment of its own imagination.



Mon, 31 Jul 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Quick Question, Quick Answer

2. HELP:Need copy of MS Quick C w/Quick assembler 2.5x for windows

3. Quick Sort, quicker, stable and anti-degeneration

4. Quick C v2.0 versus Quick C v1.0

5. Difference between Quick C and Quick C/Win

6. needed: a good quick .CHM quick ref of C#

7. dpANSI quick queries REVISED

8. Quick C test - whats the correct answer???

9. Freeing memory after malloc() - quick reply please!

10. How poke in Quick-C to PC memory ?

11. memory format quick key...

12. Quickest way to dynamically allocate STRUCT memory?

 

 
Powered by phpBB® Forum Software