After four years of iteration through v0.x, automemlimit v1.0.0 is finally here! This release simplifies the public API and improves cgroup memory limit detection.
Key changes from v0.x:
memlimit.Setreplaces thememlimit.SetGoMemLimit*functionsmemlimit.Setreturns the previousGOMEMLIMITinstead of0when configuration is skipped or an error occursmemlimit.SetsetsGOMEMLIMITtomath.MaxInt64when the provider returnsmemlimit.ErrNoLimitmemlimit.FromCgroupreplaces the version-specific cgroup providersmemlimit.WithEnv,AUTOMEMLIMIT_EXPERIMENT, andAUTOMEMLIMIT_DEBUGwere removed- Use
memlimit.FromSystemfor system memory fallback
- Use
memlimit.WithRefreshIntervalnow takes acontext.Contextfor cancellationmemlimit.WithMinwas added to set a lower bound forGOMEMLIMIT