Skip to content

Commit

Permalink
add parent process memory if children present
Browse files Browse the repository at this point in the history
  • Loading branch information
stolarczyk committed Jul 8, 2019
1 parent 45531b5 commit 1b24270
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,8 @@ 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]) if children else proc.memory_info().rss
mem_sum = (sum([x.memory_info().rss for x in children]) + proc.memory_info().rss) if children\
else proc.memory_info().rss
# return in gigs
return mem_sum/1e9
except (psutil.NoSuchProcess, psutil.ZombieProcess) as e:
Expand Down

0 comments on commit 1b24270

Please sign in to comment.