mirror of
https://github.com/criyle/go-sandbox.git
synced 2025-09-26 23:19:11 +08:00
use memory.peak for cgroup v2 as an alternative to max_usage_in_bytes
This commit is contained in:
parent
25d0f22364
commit
656b493a3f
@ -48,9 +48,9 @@ func (c *CgroupV2) MemoryUsage() (uint64, error) {
|
||||
return c.ReadUint("memory.current")
|
||||
}
|
||||
|
||||
// MemoryMaxUsage not exist, use rusage.max_rss instead
|
||||
// MemoryMaxUsage reads memory.peak
|
||||
func (c *CgroupV2) MemoryMaxUsage() (uint64, error) {
|
||||
return 0, os.ErrNotExist
|
||||
return c.ReadUint("memory.peak")
|
||||
}
|
||||
|
||||
// SetCPUBandwidth set cpu.max quota period
|
||||
|
Loading…
Reference in New Issue
Block a user