diff --git a/native/jni/core/daemon.cpp b/native/jni/core/daemon.cpp index 617646f48..5aaab0859 100644 --- a/native/jni/core/daemon.cpp +++ b/native/jni/core/daemon.cpp @@ -308,9 +308,11 @@ static void daemon_entry() { // Escape from cgroup int pid = getpid(); switch_cgroup("/acct", pid); - switch_cgroup("/dev/memcg/apps", pid); switch_cgroup("/dev/cg2_bpf", pid); switch_cgroup("/sys/fs/cgroup", pid); + if (getprop("ro.config.per_app_memcg") != "false") { + switch_cgroup("/dev/memcg/apps", pid); + } // Get self stat char buf[64];