func (m *MemInfo) Available() uint64 {
	m.mutex.RLock()
	defer m.mutex.RUnlock()
	if av, ok := m.Values["MemAvailable"]; ok {
		return av
	}
	// This will happen only on kernels < 3.14, will overestimate a tiny bit
	fr, _ := m.Values["MemFree"]
	buf, _ := m.Values["Buffers"]
	ca, _ := m.Values["Cached"]
	return fr + buf + ca
}
// Available returns the amount of still RAM available
// It uses new process mem available estimation - factors in reclaiming file
// buffers and cache.
// On Linux kernels 3.14+ it tens to err on the side of caution
// On Linux kernels older than 3.14 it's a tiny bit too optimistic, unless you
// are using next to no file buffers
Available returns the amount of still RAM available
It uses new process mem available estimation - factors in reclaiming file
buffers and cache.
On Linux kernels 3.14+ it tens to err on the side of caution
On Linux kernels older than 3.14 it's a tiny bit too optimistic, unless you
are using next to no file buffers
// Available returns the amount of still RAM available // It uses new process mem available estimation - factors in reclaiming file // buffers and cache . // On Linux kernels 3 . 14 + it tens to err on the side of caution // On Linux kernels older than 3 . 14 it ' s a tiny bit too optimistic unless you // are using next to no file buffers
func (m *MemInfo) Available() uint64 {
	m.mutex.RLock()
	defer m.mutex.RUnlock()
	if av, ok := m.Values["MemAvailable"]; ok {
		return av
	}
	fr, _ := m.Values["MemFree"]
	buf, _ := m.Values["Buffers"]
	ca, _ := m.Values["Cached"]
	return fr + buf + ca
}
func ( m * MemInfo ) Available ( ) uint64 { m . mutex . RLock ( ) defer m . mutex . RUnlock ( ) if av , ok := m . Values [ " " ] ; ok { return av } fr , _ := m . Values [ " " ] buf , _ := m . Values [ " " ] ca , _ := m . Values [ " " ] return fr + buf + ca }
Available returns the amount of still RAM available
It uses new process mem available estimation - factors in reclaiming file
buffers and cache.
Available returns the amount of still RAM available It uses new process mem available estimation - factors in reclaiming file buffers and cache .
// This will happen only on kernels < 3.14, will overestimate a tiny bit