Skip to content

Commit

Permalink
simplify conditional
Browse files Browse the repository at this point in the history
  • Loading branch information
stolarczyk committed Jul 8, 2019
1 parent 1b24270 commit e51b0e7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,8 +878,9 @@ def get_mem_child_sum(proc):
# get children processes
children = proc.children(recursive=True)
# get RSS memory of each child proc and sum all
mem_sum = (sum([x.memory_info().rss for x in children]) + proc.memory_info().rss) if children\
else proc.memory_info().rss
mem_sum = proc.memory_info().rss
if children:
mem_sum += sum([x.memory_info().rss for x in children])
# return in gigs
return mem_sum/1e9
except (psutil.NoSuchProcess, psutil.ZombieProcess) as e:
Expand Down

0 comments on commit e51b0e7

Please sign in to comment.