Win32 console application "TestPerformanceDataSet.exe" demonstrates the usage of class PerformanceDataSet which allows access to arbitrary performance counter values. More...
Win32 console application "TestPerformanceDataSet.exe" demonstrates the usage of class PerformanceDataSet which allows access to arbitrary performance counter values.
This demo application especially examines the consumption of private bytes of its own process. As can be seen in the following logs, the operating system (or the runtime library?) has its own strategy when to really allocate/deallocate memory.
Example 1 - Run with big memory allocation block:
Trying to access the specified performance counters.
In case of incorrect names it may need some time to detect the error...
Configured size of memory block: 1048576
Processortime in % Threads notepad.exe Private bytes Bytes Changed by
0.00 1 2768896 2768896
0.00 1 3825664 1056768
0.00 1 4878336 1052672
0.00 1 5935104 1056768
0.00 1 6987776 1052672
Allocated memory has been deleted
1.54 1 2768896 -4218880
0.00 1 2768896 0
0.00 1 2768896 0
Example 2 - Run with small memory allocation block:
Trying to access the specified performance counters.
In case of incorrect names it may need some time to detect the error...
Configured size of memory block: 4096
Processortime in % Threads notepad.exe Private bytes Bytes Changed by
0.00 1 2768896 2768896
1.54 1 2768896 0
37.50 1 2777088 8192
0.00 1 2777088 0
0.00 1 2785280 8192
Allocated memory has been deleted
0.00 1 2785280 0
1.56 1 2785280 0
1.56 1 2785280 0
Known problems with performance counters: http://support.microsoft.com/kb/300956/en-us