Click here to Skip to main content
15,896,473 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

For getting the peak memory usage I tried out using the API GetProcessMemoryInfo() and the structure PROCESS_MEMORY_COUNTERS::PeakWorkingSetSize.

But I am getting different values for the same process when executed twice. So I am not very sure whether this truly represents the peak memory usage.

Any suggestion or ideas are welcome.
Posted

1 solution

When testing anything on a computer, you have to take a running average. Peak memory usage will change based on what resources are available at the time. If you are truly interested, I recommend using the Red-Gate Tool Ants Performance Profiler.[^] I use that in house to look at my code. It does memory along with testing the execution times of all lines of code. It quickly showed me places where we needed to improve our code.

I don't work for Red-Gate, I just like their tools. Hope this helps you out!

Hogan
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900