You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-27Lines changed: 27 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,11 +10,7 @@ See more details about `GOMEMLIMIT` [here](https://tip.golang.org/doc/gc-guide#M
10
10
11
11
## Notice
12
12
13
-
Version `v0.5.0` introduces a fallback to system memory limits as an experimental feature when cgroup limits are unavailable. Activate this by setting `AUTOMEMLIMIT_EXPERIMENT=system`.
14
-
You can also use system memory limits via `memlimit.FromSystem` provider directly.
15
-
16
-
This feature is under evaluation and might become a default or be removed based on user feedback.
17
-
If you have any feedback about this feature, please open an issue.
13
+
Version `v1.0.0` introduces breaking changes to simplify the API. The library now provides a single `memlimit.Set` function, and system memory limits are used automatically as a fallback when cgroup limits are unavailable.
18
14
19
15
## Installation
20
16
@@ -28,40 +24,44 @@ go get github.com/KimMachineGun/automemlimit@latest
28
24
package main
29
25
30
26
// By default, it sets `GOMEMLIMIT` to 90% of cgroup's memory limit.
31
-
// This is equivalent to `memlimit.SetGoMemLimitWithOpts(memlimit.WithLogger(slog.Default()))`
32
-
// To disable logging, use `memlimit.SetGoMemLimitWithOpts` directly.
27
+
// System memory is used as a fallback if cgroup is not available.
33
28
import _ "github.com/KimMachineGun/automemlimit"
34
29
```
35
30
31
+
> **Note:** The automatic system-memory fallback applies only when you use the convenience import shown above. Calling `memlimit.Set` directly defaults to the cgroup provider; add an explicit fallback if you need it.
0 commit comments