system

package
v1.19.0 Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2022 License: Apache-2.0, MIT Imports: 4 Imported by: 11

Documentation

Index

Constants

View Source
const EnvMaximumHeap = "LOTUS_MAX_HEAP"

EnvMaximumHeap is name of the environment variable with which the user can specify a maximum heap size to abide by. The value of the env variable should be in bytes, or in SI bytes (e.g. 32GiB).

Variables

This section is empty.

Functions

This section is empty.

Types

type MemoryConstraints

type MemoryConstraints struct {
	// MaxHeapMem is the maximum heap memory that has been set by the user
	// through the LOTUS_MAX_HEAP env variable. If zero, there is no max heap
	// limit set.
	MaxHeapMem uint64

	// TotalSystemMem is the total system memory as reported by go-sigar. If
	// zero, it was impossible to determine the total system memory.
	TotalSystemMem uint64

	// EffectiveMemLimit is the memory limit in effect, in bytes.
	//
	// In order of precedence:
	//  1. MaxHeapMem if non-zero.
	//  2. TotalSystemMem if non-zero.
	//  3. Zero (no known limit).
	EffectiveMemLimit uint64
}

MemoryConstraints represents resource constraints that Lotus and the go runtime should abide by. It is a singleton object that's populated on initialization, and can be used by components for size calculations (e.g. caches).

func GetMemoryConstraints

func GetMemoryConstraints() (ret MemoryConstraints)

GetMemoryConstraints returns the memory constraints for this process.

Jump to

Keyboard shortcuts

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