Not able to enable the memory cgroup in cachyos

When running Elasticsearch docker container, it fails with the following cgroup error.

java.lang.NullPointerException: Cannot invoke "jdk.internal.platform.CgroupInfo.getMountPoint()" because "anyController" is null

A quick search shows that it might be related to memory cgroup not enabled. /proc/cgroups does not show memory subsystem.

cat /proc/cgroups | column -t
#subsys_name  hierarchy  num_cgroups  enabled
cpu           0          190          1
cpuacct       0          190          1
blkio         0          190          1
devices       0          190          1
freezer       0          190          1
net_cls       0          190          1
perf_event    0          190          1
net_prio      0          190          1
hugetlb       0          190          1
pids          0          190          1
rdma          0          190          1
misc          0          190          1

So, I added some additional kernel params to /etc/sdboot-manage.conf:

cgroup_enable=memory cgroup_memory=1

then ran sudo sdboot-manage gen and rebooted. I verified that I see the new kernel params in /prod/cmdline.

But, the memory subsystem is still not listed in /proc/cgroups and elasticsearch docker container still fails to start.

Any pointers to get the memory cgroup enabled would be much appreciated. Thanks.

Possibly your kernel was built without support. There is also the important distinction of whether its attempting to use cgroup v1 or v2.

What is the output of

zgrep 'CONFIG_MEMCG' /proc/config.gz

and

uname -a

Hi @NiceTM

zgrep 'CONFIG_MEMCG' /proc/config.gz

CONFIG_MEMCG=y
# CONFIG_MEMCG_V1 is not set
uname -a

Linux workstation 6.12.0-2-cachyos #1 SMP PREEMPT_DYNAMIC Mon, 18 Nov 2024 18:02:00 +0000 x86_64 GNU/Linux

Hi @NiceTM any ideas here?

Actually, never mind. Switching to a newer version of the elasticsearch docker image fixed the error for me.