1.Intall Windows Kits.
note:
-
All options are default, and click finsh to complete the installation.
-
Recommended installation path or sdk version:(some sdk version gflags can not be started )
2. Config symble path
-
Add pdb files path("C:\XX\XX") to _NT_SYMBOL_PATH
eg: _NT_SYMBOL_PATH="C:\XX\XX"
3.Config gflags
cmd:gflags or double click gflags in "C:\Program Files (x86)\Windows Kits\10\Debuggers\x86"
4.Set gflags for process, GFlags is most often used to turn on debugging, logging and test features.
gflags -i <ImageFileName> +ust
-i: operates on settings for a specific image file.
+ust: create user mode stack trace database.
eg: gflags -i RSLinxNG.exe +ust
5.Use umdh to store current memory status
umdh -pn:<exe name> -f:<SavePath>
eg: umdh -pn:RSLinxNG.exe -f:C:\initialMemory.txt
6.Exercise the program you suspect has a memory leak for a while.
7.Stop your program and use umdh to store current memory status
umdh -pn:<ImageFileName> -f:<SavePath>
eg: umdh -pn:RSLinxNG.exe -f:C:\finalMemory.txt
8.Compare two files
umdh -d <file1 path> <file2Path> > <resultFilePath>
eg:umdh -d C:\initialMemory.txt c:\finalMemory.txt >comparedResult.txt
9.When we finish test about UMDH, GFlags should be clear; otherwise, it will affect our next performance test.
GFlags –r -ffffffff