<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
</head><body style="">
<div>
<br />> Lennart Poettering <lennart@poettering.net> hat am 20. August 2014 um 15:14 geschrieben:
<br />>
<br />>
<br />> On Wed, 20.08.14 09:08, Christian Häßelbarth (mail@christianhaesselbarth.de) wrote:
<br />>
<br />> > Hi all,
<br />> >
<br />> > I'm using systemd in version 197.
<br />> > I've observed that the heap size of the journald continuously grows.
<br />> >
<br />> > I used "cat /proc/[PID_OF_JOUNALD]/smaps for observing the heap size.
<br />> >
<br />> > Right after starting the heap size is about 772 kB
<br />> >
<br />> > 10041000-10102000 rwxp 00000000 00:00 0 [heap]
<br />> > Size: 772 kB
<br />> > Rss: 652 kB
<br />> > Pss: 652 kB
<br />> > Shared_Clean: 0 kB
<br />> > Shared_Dirty: 0 kB
<br />> > Private_Clean: 0 kB
<br />> > Private_Dirty: 652 kB
<br />> > Referenced: 652 kB
<br />> > Anonymous: 652 kB
<br />> > AnonHugePages: 0 kB
<br />> > Swap: 0 kB
<br />> > KernelPageSize: 4 kB
<br />> > MMUPageSize: 4 kB
<br />> > Locked: 0 kB
<br />> >
<br />> >
<br />> > After 7 days of operation the heap size is about 6272 kB
<br />> >
<br />> > 10041000-10102000 rwxp 00000000 00:00 0 [heap]
<br />> > Size: 6272 kB
<br />> > Rss: 6172 kB
<br />> > Pss: 6172 kB
<br />> > Shared_Clean: 0 kB
<br />> > Shared_Dirty: 0 kB
<br />> > Private_Clean: 0 kB
<br />> > Private_Dirty: 6172 kB
<br />> > Referenced: 6172 kB
<br />> > Anonymous: 6172 kB
<br />> > AnonHugePages: 0 kB
<br />> > Swap: 0 kB
<br />> > KernelPageSize: 4kB
<br />> > MMUPageSize: 4kB
<br />> > Locked: 0 kB
<br />> >
<br />> > My journald.conf is the following
<br />> >
<br />> > [Journal]
<br />> > Storage=none
<br />> > #Compress=yes
<br />> > #Seal=yes
<br />> > #SplitMode=login
<br />> > #RateLimitInterval=10s
<br />> > #RateLimitBurst=200
<br />> > #SystemMaxUse=
<br />> > #SystemKeepFree=
<br />> > #SystemMaxFileSize=
<br />> > #SystemMinFileSize=
<br />> > #RuntimeMaxUse=1M
<br />> > #RuntimeKeepFree=
<br />> > #RuntimeMaxFileSize=
<br />> > #RuntimeMinFileSize=
<br />> > #ForwardToSyslog=yes
<br />> > #ForwardToKMsg=no
<br />> > #ForwardToConsole=no
<br />> > #TTYPath=/dev/console
<br />> > #MaxLevelStore=debug
<br />> > #MaxLevelSyslog=debug
<br />> > #MaxLevelKMsg=notice
<br />> > #MaxLevelConsole=info
<br />> >
<br />> >
<br />> > Is it a known bug in version 197?
<br />>
<br />> We keep a cache of open journal files with state. If we never have
<br />> written to anything we don't have anything open, so we use much less
<br />> memory.
<br />>
<br />> And there's more, for example our hashmaps use an allocation cache,
<br />> which will show up as heap usage.
<br />>
<br />> Just looking at the smaps file isn't really a way to identify leaks. And
<br />> allocation caches are a pretty common thing that always appear as heap
<br />> usage, even though the memory isn't leaked.
<br />>
<br />> Lennart
<br />>
<br />> --
<br />> Lennart Poettering, Red Hat
</div>
<div>
</div>
<div>
<div>
Thanks for your answer!
</div>
<div>
</div>
<div>
I've set the storage option to "none" in my journal.conf, assuming that journald will drop all data. Is that correct?
</div>
<div>
I'm using systemd in an embedded device context and I would like to save memory. I understand your point regarding allocation cache etc.
</div>
<div>
</div>
<div>
If I get you right then it is quite normal that journald allocates ~6 MB of memory.
</div>
<div>
Is there any configuration option to avoid this high memory usage? For exampel with the options storage=yes and SystemMaxUse=1MB ?
</div>
<div>
</div>
<div>
Regards
</div> Christian
</div>
</body></html>