Fixed: missing brackets when appending proc info on OutOfMemory (#5530)

* Fixed: missing brackets when appending proc info on OutOfMemory

proc_stats.append was missing the set of brackets when adding a tuple to the list, which resulted in runtime error instead of correct Out of Memory message display.

* Update memory_monitor.py
This commit is contained in:
Andrey K
2019-08-24 18:33:20 -07:00
committed by Eric Liang
parent 28623d2eac
commit d41963c546
+2 -1
View File
@@ -43,7 +43,8 @@ class RayOutOfMemoryError(Exception):
proc_stats = []
for pid in pids:
proc = psutil.Process(pid)
proc_stats.append(get_rss(proc.memory_info()), pid, proc.cmdline())
proc_stats.append((get_rss(proc.memory_info()), pid,
proc.cmdline()))
proc_str = "PID\tMEM\tCOMMAND"
for rss, pid, cmdline in sorted(proc_stats, reverse=True)[:10]:
proc_str += "\n{}\t{}GiB\t{}".format(