meminfo

package
v24.0.0-rc.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 12, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package meminfo provides utilites to retrieve memory statistics of the host system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

type Memory struct {
	// Total usable RAM (i.e. physical RAM minus a few reserved bits and the
	// kernel binary code).
	MemTotal int64

	// Amount of free memory.
	MemFree int64

	// Total amount of swap space available.
	SwapTotal int64

	// Amount of swap space that is currently unused.
	SwapFree int64
}

Memory contains memory statistics of the host system.

func Read

func Read() (*Memory, error)

Read retrieves memory statistics of the host system and returns a Memory type. It is only supported on Linux and Windows, and returns an error on other platforms.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL