memory

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SkipCleanupRoutine      = false
	BlockExecutionThreshold = uint64(0.1 * float64(TotalMemory()))
	TriggerCleanupThreshold = uint64(0.5 * float64(TotalMemory()))
)

Functions

func AvailableMemory

func AvailableMemory() uint64

func Lock

func Lock(ctx context.Context)

Lock ensures only one execution of the memory checking process and holds the code execution where the function is called

func LockWithTrigger added in v0.0.19

func LockWithTrigger(ctx context.Context, triggerFunc func())

LockWithTrigger ensures only one execution of the memory checking process and holds the code execution where the function is called

func SizeInString

func SizeInString(size uint64) string

func SizeOf

func SizeOf(v any) uint64

Of returns the size of 'v' in bytes. If there is an error during calculation, Of returns -1.

func SizeOfString

func SizeOfString(instance any) string

func TotalMemory

func TotalMemory() uint64

Types

This section is empty.

Jump to

Keyboard shortcuts

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