Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
259 views
in Technique[技术] by (71.8m points)

/sys/fs/cgroup/memory/memory.limit_in_bytes not present in Fedora 33

I have an old script that do

$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)

In fedora 33 this file is not present.

What can I do to resolve this?

Thanks.

question from:https://stackoverflow.com/questions/65646317/sys-fs-cgroup-memory-memory-limit-in-bytes-not-present-in-fedora-33

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The issue is related to new cgroup v2. To resolve this, revert cgroup to v1:

sudo sed -i '/^GRUB_CMDLINE_LINUX/ s/"$/ systemd.unified_cgroup_hierarchy=0"/' /etc/default/grub

and reboot.

After this /sys/fs/cgroup/memory/memory.limit_in_bytes will be present.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...