views:

696

answers:

2

Let's put Heisenberg aside for a brief moment.

How would I go about to, from within my own process, monitor how much memory this process is using?

(I might have under-specified the question on purpose, dreaming of creative answers...)

+2  A: 

Use GetProcessMemoryInfo()

WorkingSetSize in PROCESS_MEMORY_COUNTERS_EX seems to be what you want.

Quassnoi
Would have been great - outside of Windows Mobile (where I operate). Thanks, for the tip, though.
Johann Gerell
+5  A: 

Quassnoi is correct - but it also might be worth checking our this question:

How to determine CPU and memory consumption from inside a process which includes code examples

John Sibly