0

When running systemd-cgtop, I get the following result (showing just the first few lines):

Control Group                                                                                                          Tasks   %CPU   Memory  Input/s Output/s
/                                                                                                                       1752   92.2    29.0G        -        -
/mycgroup                                                                                                                -      -     3.3M        -        -
/system.slice                                                                                                             98      -        -        -        -
/system.slice/ModemManager.service                                                                                         3      -        -        -        -
/system.slice/NetworkManager.service                                                                                       4      -        -        -        -
/system.slice/accounts-daemon.service                                                                                      3      -        -        -        -
/system.slice/acpid.service     

Notice that my cgroup, which is on the second row, uses up about 3.3M of memory. Indeed, I get the following when I run

cat /var/cgroups/mycgroup/memory.usage_in_bytes 
3530752

I am not sure where this memory usage is coming from. How might I go about detecting who is using this memory, and what might I do to force a stop to memory usage by all processes in this cgroup without deleting the cgroup?

Other cgroups I have do not consume this memory.

user308485
  • 275
  • 2
  • 7

1 Answers1

0

I believe this is showing un-reclaimed cache memory. Most likely, you did have a task running in the cgroup at one time, but then stopped it. The cached memory may remain.

If no tasks are running in the cgroup, you have the ability to force empty:

echo 0 >/sys/fs/cgroup/memory/mycgroup/memory.force_empty
guzzijason
  • 1,410
  • 8
  • 18