<html>
<head>
<base href="https://bugs.freedesktop.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Priority</th>
<td>medium
</td>
</tr>
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW --- - Setting MemoryLimit does not imply "MemoryAccounting=true""
href="https://bugs.freedesktop.org/show_bug.cgi?id=78738">78738</a>
</td>
</tr>
<tr>
<th>Assignee</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Summary</th>
<td>Setting MemoryLimit does not imply "MemoryAccounting=true"
</td>
</tr>
<tr>
<th>QA Contact</th>
<td>systemd-bugs@lists.freedesktop.org
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Reporter</th>
<td>andy.melnikov@gmail.com
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Component</th>
<td>general
</td>
</tr>
<tr>
<th>Product</th>
<td>systemd
</td>
</tr></table>
<p>
<div>
<pre><a href="http://www.freedesktop.org/software/systemd/man/systemd.resource-control.html">http://www.freedesktop.org/software/systemd/man/systemd.resource-control.html</a>
says that MemoryLimit implies "MemoryAccounting=true".
But it's not the case. If I don't put an explicit "MemoryAccounting=true" in
the unit file below, service control groups under memory is not created and
memory limit doesn't work.
----
[Unit]
Description=foo
After=network.target
[Service]
User=bar
WorkingDirectory=/home/bar
ExecStart=/usr/bin/foo
Restart=always
RestartSec=5min
MemoryLimit=256M
[Install]
WantedBy=multi-user.target
----
[root@quux ~]# systemctl show foo -p MemoryLimit
MemoryLimit=268435456
[root@quux ~]# systemctl show foo -p MemoryAccounting
MemoryAccounting=no</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the QA Contact for the bug.</li>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>