Use system memory limits as a fallback
mainIf cgroup limits are unavailable, you can use system memory limits. This can be done in two ways:
- Environment Variable: Set
AUTOMEMLIMIT_EXPERIMENT=systemto enable experimental fallback to system memory limits. - Programmatically: Use
memlimit.FromSystemas a provider, or usememlimit.ApplyFallback(memlimit.FromCgroup, memlimit.FromSystem)to attempt cgroup detection first and fall back to system limits if cgroups are not found.