Skip to content

Commit

Permalink
systemd: Add MemoryMax constraint to deal with memory leaks in the SDK
Browse files Browse the repository at this point in the history
Memory leaks in the SDK can exhaust all memory. Make OOM killer kill
the app when memory usage goes too high. Systemd will then restart the
unit automatically.
  • Loading branch information
wentasah committed Mar 9, 2022
1 parent c97e7cd commit ed790e0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions thermocam-pcb.service.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,10 @@ WatchdogSec=60
TimeoutStopSec=10
WorkingDirectory=%h/thermocam-pcb

# Memory leaks in the SDK can exhaust all memory. Make OOM killer kill
# the app when memory usage goes too high. Then, the unit will be
# restarted due to Restart=always.
MemoryMax=1G

[Install]
WantedBy=default.target

0 comments on commit ed790e0

Please sign in to comment.