mirror of
https://github.com/minio/minio.git
synced 2025-05-03 07:50:32 -04:00
fix: parsing v2 and v1 cgroup memory limit (#19153)
Trim the newline at the end of the sysfs memory limit.
This commit is contained in:
parent
40fb3371fa
commit
9a7c7ab2d0
@ -22,6 +22,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"runtime"
|
"runtime"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@ -70,7 +71,7 @@ func cgroupMemLimit() (limit uint64) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
limit, err = strconv.ParseUint(string(buf), 10, 64)
|
limit, err = strconv.ParseUint(strings.TrimSpace(string(buf)), 10, 64)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
// The kernel can return valid but non integer values
|
// The kernel can return valid but non integer values
|
||||||
// but still, no need to interpret more
|
// but still, no need to interpret more
|
||||||
|
Loading…
x
Reference in New Issue
Block a user