mem

package
v0.0.0-...-a518d66 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package mem is a library that counts system and process memory usage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Process

type Process struct {
	Alloc      uint64 `json:"alloc"`       // allocated memory capacity, unit(M)
	TotalAlloc uint64 `json:"total_alloc"` // cumulative allocated memory capacity, unit(M)
	Sys        uint64 `json:"sys"`         // requesting memory capacity from the system, unit(M)
	NumGc      uint32 `json:"num_gc"`      // number of GC cycles
}

Process memory information

func GetProcessMemory

func GetProcessMemory() *Process

GetProcessMemory get process memory

type System

type System struct {
	Total        uint64  `json:"total"`         // total physical memory capacity, unit(M)
	Free         uint64  `json:"free"`          // free physical memory capacity, unit(M)
	UsagePercent float64 `json:"usage_percent"` // memory usage, unit(%)
}

System memory information

func GetSystemMemory

func GetSystemMemory() *System

GetSystemMemory get system memory

Jump to

Keyboard shortcuts

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