Skip to content

Commit

Permalink
return parent mem usage in case no chidren exist
Browse files Browse the repository at this point in the history
  • Loading branch information
stolarczyk committed Jul 8, 2019
1 parent 1503fef commit 7d35dab
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pypiper/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -878,7 +878,7 @@ 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])
mem_sum = sum([x.memory_info().rss for x in children]) 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 7d35dab

Please sign in to comment.