A customer was calling GetÂGuiÂResources
for each process and adding up the results and comparing that with just calling GetÂGuiÂResources
once with GR_
. They found that the values didn’t match. What’s going on?
If you are doing this with the *_PEAK
values, then it’s to be expected that adding the individual peaks will not match the global peak. After all, it’s almost certainly not the case that all of the processes reached their peak at the same time. Adding up the individual peaks will overshoot the global peak.
Time | Objects | ||
---|---|---|---|
Process 1 | Process 2 | Global | |
t = 1 | 100 | 10 | 110 |
t = 2 | 50 | 50 | 100 |
Peak | 100 | 50 | 110 |
On the other hand, if you add up the instantaneous counts, you will probably come up with a total less than the global value. That’s because there are some objects which are considered owned by the system itself and not any specific process. Examples include objects on the clipboard, stock objects, and certain types of bitmaps. Those system-owned objects count toward the global value but are not charged to any process.
0 comments