automemlimit

package
v0.0.0-...-21d585c 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: 3 Imported by: 1

Documentation

Overview

Package automemlimit implements a service activity that sets the GOMEMLIMIT1 to be a percentage of the total cgroup memory limit. This is useful for containerized environments where the GC will not be able to detect the total memory available to the process and thus will not be able to properly determine when an out of memory condition is about to occur in relation to freeing memory.

This is controllable with environment variables provided by the automemlimit package2.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceActivity

type ServiceActivity struct{}

ServiceActivity implements the async.Runner & Closer interface for setting GOMEMLIMIT properly in a containerized environment.

func New

func New() *ServiceActivity

New creates a new automemlimit service activity

func (*ServiceActivity) Close

func (s *ServiceActivity) Close(_ context.Context) error

Close closes the automemlimit service activity. This is a noop.

func (*ServiceActivity) Run

func (s *ServiceActivity) Run(ctx context.Context) error

Run runs the automemlimit service activity

Jump to

Keyboard shortcuts

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