title: systemd MemoryLimit not enforced
body: <p>I am running systemd version 219.
  root@EVOvPTX1_RE0-re0:/var/log# systemctl --version
  systemd 219
  +PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT +GNUTLS +ACL +XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN</p>
  
  <p>I have a service, let's call it foo.service which has the following.</p>
  
  <p>[Service]
  MemoryLimit=1G</p>
  
  <p>I have deliberately added code to allocate 1M memory 4096 times which causes
  4G memory alloc when a certain event is received. The idea is that after
  the process consumes 1G of address space, memory alloc would start failing.
  However, this does not seem to be the case. I am able to alloc 4G memory
  without any issues. This tells me that the memory limit specified in the
  service file is not enforced.</p>
  
  <p>Can anyone let me know what am I missing ?</p>
  
  <p>I looked at the proc file system - file named limits. This shows that the
  Max address space is Unlimited, which also confirms that the memory limit
  is not getting enforced.</p>