[ZBX-8809] system.swap.size returns wrong values on Windows Created: 2014 Sep 23  Updated: 2020 Aug 13  Resolved: 2014 Oct 27

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.4.0
Fix Version/s: None

Type: Incident report Priority: Minor
Reporter: Jens Berthold Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: swap, windows
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS: Windows 2008 R2 SP1


Issue Links:
Duplicate
is duplicated by ZBX-18180 Incorrect swap utilization on certain... Need info

 Description   

Example:
Performance counter says 8.6% used while system.swap.size[,pfree] thinks 0% are free.

root@zabbix:~# zabbix_get -s 1.2.3.4 -k 'system.swap.size[,pfree]'
0.000000
root@zabbix:~# zabbix_get -s 1.2.3.4 -k 'system.swap.size[,free]'
0
root@zabbix:~# zabbix_get -s 1.2.3.4 -k 'perf_counter[\700(_Total)\702]'
8.621216

Please note that the performance counter \700(_Total)\702 equals \Paging File(_Total)\ % Usage.



 Comments   
Comment by Jens Berthold [ 2014 Sep 23 ]

Maybe this is related to the changes done in ZBX-5970 or ZBXNEXT-2225.

Comment by Andris Zeila [ 2014 Sep 24 ]

Is the Windows running in virtualized environment?
Could you please tell the result of system.swap.size[,total] and the real swap file and physical memory sizes on this system?

Comment by Jens Berthold [ 2014 Sep 24 ]

Yes, it is a VMWare ESXi virtualized Windows.
system.swap.size[,total] = 510.18 MB

Comment by Andris Zeila [ 2014 Sep 24 ]

Thanks, and the real swap/memory sizes ?

Comment by Jens Berthold [ 2014 Sep 24 ]

Memory: 8,588,886,016 Bytes
Swap (Pagefile.sys on disk): 536,870,912 Bytes
You're welcome

Comment by Andris Zeila [ 2014 Sep 25 ]

Thanks, we had some weird results returned by Windows GlobalMemoryStatus*() functions in virtual environmnet (ESXi and VirtualBox). We will investigate it further.

Comment by Andris Zeila [ 2014 Oct 07 ]

After some testing I can confirm that in virtualized environments Windows is reporting memory usage values which I cannot currently explain.

When monitoring Available Bytes, Committed Bytes, Commit Limit one would expect that page file usage to be calculated as:

Physical Memory Used = Physical Memory Total - Available Bytes
Swap Used = Committed Bytes - Physical Memory Used
Swap Used % = 100 * Swap Used / Swap Total

In non virtualized environment it matches the pagefile usage % performance counter, while on virtualized systems the difference can be quite large.

Comment by Andris Zeila [ 2014 Oct 07 ]

(1) So currently we suggest using performance counters to obtain swap file statistics on virtualized Windows platforms.

The documentation was updated accordingly, please review:

sasha CLOSED

Comment by Vlad Krutov [ 2016 Oct 15 ]

have the same issue on Zabbix 3.2, windows server 2012r2, esxi 6.0u2

Free swap space reporting 0 on system.swap.size[,free] and perf_counter[\700(_Total)\702]

Generated at Wed Jun 18 07:56:51 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.