[systemd-devel] systemctl show outputs incorrect MemoryCurrent value

George Xie georgexsh at gmail.com
Wed Jul 25 03:23:55 UTC 2018


thanks for your reply.

odds enough, on both aforementioned boxes, MemoryAccounting is set to no:

    $ systemctl show crond | grep MemoryAccounting
    MemoryAccounting=no

besides, I found that box B could also output a correct TasksCurrent value,
but with setting `TasksAccounting=no`:

    $ systemctl show crond | grep Tasks
    TasksCurrent=1
    TasksAccounting=no
    TasksMax=18446744073709551615

the good news is, after setting `DefaultMemoryAccounting=yes` in
/etc/systemd/system.conf, and a `systemctl daemon-reexec`, all units have
correct memory usage info.

Regards,

Xie Shi
http://xerr.net/


On Tue, Jul 24, 2018 at 8:33 PM, Lennart Poettering <lennart at poettering.net>
wrote:

> On Di, 24.07.18 20:12, George Xie (georgexsh at gmail.com) wrote:
>
> > on box A, systemctl show outputs an incorrect value for unit memory
> usage:
> >
> >     [box A] $ systemctl show crond | grep MemoryCurrent
> >     MemoryCurrent=18446744073709551615
> >
> > 18446744073709551615 == UINT64_MAX, this must be incorrect.
>
> This is returned if memory accounting is not enabled for the unit.
>
> Set MemoryAccounting=yes in the unit to enable it.
>
> Lennart
>
> --
> Lennart Poettering, Red Hat
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/systemd-devel/attachments/20180725/dc8e1f01/attachment.html>


More information about the systemd-devel mailing list