The problem is about the systemd services. I know we can limit the Memory Usage or Cpu usage of services but my question is that is there a way to restart service when it reaches to its Memory high limit(or cpu)? Because i want to know that if the service is out of memory(leak) it has to restart again. I used these in unit file for limiting memory and cpu of service:
MemoryHigh=100K
MemoryMax=150K
CPUQuota=10%