On Windows system.memory.swap.total shows 2GB although there is no swap

We run metricbeat-oss-7.9.2-windows-x86_64.zip on Windows Server 2016 and send data to Kafka. From Kafka, we consume data with Logstash and send them to ElasticCloud.
We observe an issue with system.memory.swap.* metrics, which show non-zero values, although swap is completely disabled on the servers.

Metricbeat uses gosigar library, which internally runs the following code:

func (self *Swap) Get() error {
	memoryStatusEx, err := windows.GlobalMemoryStatusEx()
	if err != nil {
		return errors.Wrap(err, "GlobalMemoryStatusEx failed")
	}

	self.Total = memoryStatusEx.TotalPageFile
	self.Free = memoryStatusEx.AvailPageFile
	self.Used = self.Total - self.Free
	return nil
}

This might be a reason why you're observing non-zero values.

@mtojek Thanks for your reply.
Although it does not solve the issue we experience, it can help to fix the bug.

Do you confirm this is a bug, so I can open an issue on Github?

Could you please paste any wrong reports you received? Are these random values?

@goodmirek5849, we have an open issue already https://github.com/elastic/beats/issues/19875 and we are investigating other paths here, meanwhile you can use the workaround suggested in the issue.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.