为什么 systemctl 显示内存当前为 [未设置]?

为什么 systemctl 显示内存当前为 [未设置]?

我一直在尝试按照本教程来限制 Firefox 的内存使用量:https://dev.to/msugakov/taking-firefox-memory-usage-under-control-on-linux-4b02

在其中,我们使用 systemd 来限制 Firefox 的内存使用量

systemd-run --unit=my-firefox --user --scope -p MemoryHigh=6G -p MemoryMax=7G -p MemorySwapMax=0 firefox

然后通过 systemctl 检查内存使用情况

systemctl --user show my-firefox.scope | grep Memory

不幸的是,就我而言,我没有在 MemoryCurrent 中设置,如下所示的输出:

$ systemctl --user show limited-firefox.scope | grep Memory
MemoryCurrent=[not set]
EffectiveMemoryNodes=
AllowedMemoryNodes=
MemoryAccounting=yes
DefaultMemoryLow=0
DefaultMemoryMin=0
MemoryMin=0
MemoryLow=0
MemoryHigh=2147483648
MemoryMax=3221225472
MemorySwapMax=0
MemoryLimit=infinity

我是否遗漏了某些东西,或者我的系统存在问题?

相关内容