Please enable JavaScript to view this site.

Memory Validator Help

Navigation: Examples

Session comparison

Scroll Prev Top Next More

 

Session comparison

 

Session comparison can be used as part of manual regression testing to detect any differences between sessions including leaks, errors, or anything else.

 

A good practice might be to also use session comparison with automated regression tests to provide similar data on a daily basis.

 

This helps developers or quality assurance departments track issues on a continual basis rather than when just things get so bad that something needs to be done.

 

 

Example session comparison

 

To demonstrate a simple session comparison we'll run the example application twice.

 

In the second run we'll allocate more objects that are not deallocated than in the first run.

 

We'll use Memory Validator to compare the two sessions to show which leaks are common to both runs and which leaks were present only in the second run.

 

 

mvMemVal

 

menu Managers menu instructionStep Session Manager instructionStep set Maximum number of sessions to at least 2 instructionStep allows several sessions to be kept at the same time

 

launch nativeExample.exe instructionStep wait until attaching is complete

 

 

nativeExample1  

 

menu File menu instructionStep Exit

 

 

mvMemVal

 

wait for data transfer to complete

 

This first run is the baseline session.

 

launch nativeExample.exe instructionStep wait until attaching is complete

 

 

nativeExample1  

 

menu Allocations menu instructionStep C Runtime (C/C++) Heap instructionStep Allocate memory... instructionStep shows the Test Memory dialog instructionStep OK to accept the default values

 

menu File menu instructionStep Exit

 

 

mvMemVal

 

wait for data transfer to complete

 

This second run is the comparison session.

 

Now that we have two sessions, we can compare them to look for common leaks, improvements and regressions.

 

menu Managers menu instructionStep Session Manager instructionStep select the two recent sessions

 

example-session-comparison-manager

 

Compare instructionStep shows the compare sessions dialog instructionStep check the baseline session is the one with the earlier timestamp

 

example-session-comparison-chooser

 

Compare instructionStep shows the Session Memory Comparison dialog

 

The Session Memory Comparison dialog displays all the regression, improvements and leaks common to both sessions.

 

You can filter, search and export the results, search the results and export the results as HTML or XML.

 

In this example you should see one item marked as a regression, and all the rest of the leaks being common to both sessions.

 

example-session-comparison-result

 

 

expand the regression item instructionStep shows the regression leak allocation in CTeststakView::OnTestAllocatememory()

 

example-session-comparison-result-expanded