gc

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, cfg *config.Cache)

Run periodically forces Go's garbage collector and tries to return freed pages back to the OS. ---------------------------------------------- Why is this needed?

This service is a high-load in-memory cache. Once the cache reaches its target size (e.g., 10-20 million keys), the heap stabilizes at a large size — for example, 18 GB. By default, Go's GC will only run a full collection if the heap grows by GOGC% (default 100%). This means the next GC cycle could be delayed until the heap doubles again (e.g., 36 GB).

Types

This section is empty.

Jump to

Keyboard shortcuts

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