We help IT Professionals succeed at work.

Find Memory Usage

rammohan_77
rammohan_77 asked
on
I have an vc++ application(an exe)
i want to know the memory usage of the exe.i.e
i want to write the memory & CPU usage of my application
from time to time in ABC.txt file how can i do.

What is the syntax or method to get the memory usage of
my exe .

In any language use C/C++/VC++.

I am using WIN2000 OS.
Comment
Watch Question

Commented:
Check GetCurrentProcess() and GetProcessMemoryInfo().
use like:

#include <psapi.h>
       :
    HANDLE hdl = GetCurrentProcess();
    PROCESS_MEMORY_COUNTERS mem;
    GetProcessMemoryInfo(hdl, &mem, sizeof(mem));
    DWORD workingSet = mem.WorkingSetSize;
    DWORD pagefile = mem.PagefileUsage;
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by: kuro

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer

Explore More ContentExplore courses, solutions, and other research materials related to this topic.