VMware Cloud Community
djinn_fr
Contributor
Contributor

swap used in windows

Can somebody tell me how is calculated "swap used" in Windows or at least where to look in the source code.

Thanks
0 Kudos
2 Replies
admin
Immortal
Immortal

The swap used metric is gathered using SIGAR.

http://support.hyperic.com/confluence/display/SIGAR/Home

I believe the swap metric is just a counter in the PDH. See win32_sigar.c in the SIGAR source code for the details.

-Ryan
0 Kudos
djinn_fr
Contributor
Contributor

Thanks for your answer.

Looking at win32_sigar.c, I can see:

swap->total = memstat.ullTotalPageFile;
swap->free = memstat.ullAvailPageFile;

and swap used:
swap->used = swap->total - swap->free;

So basically in Windows, swap used is the number of TotalPageFile - AvailPageFile.
0 Kudos