@YIL answer is right:
"cgroup_enable=cpuset cgroup_memory=1 cgroup_enable=memory" should be added to the end of the first line of the file /boot/firmware/cmdline.txt instead of being added at a new line