-
Memory Usage
I have developed two different algorithms(with two different data structures). How can I find the as to which of the two is better in terms of memory usage. In other words, after execution of a certain amount of the algorithm I want to know how much memory is being consumed by the application. How can this be done in VC++.
=====
I used the following functions _CrtMemCheckpoint() & _CrtMemDifference( ), & the memory usage difference through the Task Manager. There is great disparity between them, also the task manager shows different values with different runs. Whats the reason for this disparity (No other program was running at that time). Which of the two methods (Task Manager OR Memory debugging fucntions) is more reliable. Also I m a little unsure as to how the statistics produced by these function calls are interpreted.
-
Hi,
You have several ways to do that.
1. Look at Task Manager and see how much memory your app are using
2. Use Debug Routines functions. Look in MSDN at
Code:
void _CrtMemCheckpoint(
_CrtMemState *state
);
int _CrtMemDifference(
_CrtMemState *stateDiff,
const _CrtMemState *oldState,
const _CrtMemState *newState
);