Add file named e.g. 'wslimit.conf' under '/etc/systemd/system/deluged.service.d' (make dir if not already there):
Code: Select all
[Service]
MemoryMax=512M
Finally run 'sudo systemctl daemon-reload'.
(Alternate way being simply running 'sudo systemctl edit deluged', adding the part in codebox above(both lines, added between the two comment-blocks where cursor initially is) and save/exit, which automatically generates 'deluged.service.d' dir if not there, the override file therein, and runs daemon-reload too).
To remove this fix, then simply delete wslimit.conf(override.conf if used alternate way above), and if made the deluged.service.d dir yourself for this, then delete that too, and end with 'sudo systemctl daemon-reload'.
Same trick can be done for dockers through adding the '-m 512m' option to the commands generating the docker image e.g.:
Code: Select all
sudo docker run -d \
--name deluge \
[...] \
-m 512m \
lscr.io/linuxserver/deluge:latest
Code: Select all
sudo systemd-run --scope -p MemoryMax=512M --uid=deluge -u deluged deluged
Anyway, for all solutions you can check 'free -m' now doesn't use up all your memory during torrenting(listed in 'buff/cache' section, not 'used', and where 'free' very small without this trick). Also, under 'Memory' section of 'sudo systemctl status deluged'(service extension is implied when not given, so need specify 'deluged.scope' specifically for 'systemd-run'), or 'sudo systemd-cgtop', and for dockers under 'mem usage / limit' section of 'sudo docker stats deluge'.
Sorry no solution yet for non-systemd systems, but hope helps somewhat at least still.
Edit: Just stumbled over easiest method, just simply run:
Code: Select all
sudo systemctl set-property deluged MemoryMax=512M