diff --git a/nohang b/nohang index 58433b5..6a1972d 100755 --- a/nohang +++ b/nohang @@ -611,7 +611,7 @@ def pid_to_status(pid): for n, line in enumerate(f): - if n is 0: + if n == 0: name = line.split('\t')[1][:-1] if n is state_index: @@ -663,7 +663,7 @@ def pid_to_status_unicode(pid): for i in range(len(f_list)): - if i is 0: + if i == 0: name = f_list[i].split('\t')[1] if i is state_index: @@ -793,7 +793,7 @@ def check_mem_and_swap(): """find mem_available, swap_total, swap_free""" with open('/proc/meminfo') as f: for n, line in enumerate(f): - if n is 2: + if n == 2: mem_available = int(line.split(':')[1][:-4]) continue if n is swap_total_index: diff --git a/nohang.service.in b/nohang.service.in index 1e16c27..be09fd3 100644 --- a/nohang.service.in +++ b/nohang.service.in @@ -9,6 +9,7 @@ KillMode=mixed OOMPolicy=continue Nice=-15 CPUSchedulingResetOnFork=true +MemoryMin=50% [Install] WantedBy=multi-user.target diff --git a/oom-sort b/oom-sort index 3e9ffb1..ac9c8d9 100755 --- a/oom-sort +++ b/oom-sort @@ -42,7 +42,7 @@ def pid_to_status_units(pid): for i in range(len(f_list)): - if i is 1: + if i == 1: name = f_list[0].split('\t')[1] if i == uid_index: