mem

package
v1.4.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

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"`       // 分配内存容量,单位(M)
	TotalAlloc uint64 `json:"total_alloc"` // 累计分配内存容量,单位(M)
	Sys        uint64 `json:"sys"`         // 从系统申请内存容量,单位(M)
	NumGc      uint32 `json:"num_gc"`      // 已完成的GC周期的数量
}

Process 进程内存信息

func GetProcessMemory

func GetProcessMemory() *Process

GetProcessMemory get process memory

type System

type System struct {
	Total        uint64  `json:"total"`         // 物理内存总容量,单位(M)
	Free         uint64  `json:"free"`          // 可用物理内存容量,单位(M)
	UsagePercent float64 `json:"usage_percent"` // 内存使用率,单位(%)
}

System 系统内存信息

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