membudget

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package membudget detects the memory budget available to the process — (in order) cgroup v2, cgroup v1, then host RAM from /proc/meminfo — so consumers can scale their allocations against the actual quota instead of hardcoding sizes. Used by the GOMEMLIMIT bootstrap in package main and the SQLite cache/mmap sizing in internal/storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Detect

func Detect() (int64, string)

Detect returns the applicable memory budget in bytes and its source, or (0, "") if nothing usable is found. cgroup limits take precedence over host RAM so containerized deployments pace against their actual quota.

Types

This section is empty.

Jump to

Keyboard shortcuts

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