Skip to content

Commit 429e5bb

Browse files
committed
Fix typo in PID clause of memory_usage
It looks like the PID multiprocess code was copied from the Popen clause. `_get_child_memory` called with just `proc`, not `proc.pid`
1 parent 306acd1 commit 429e5bb

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

memory_profiler.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,13 +405,13 @@ def memory_usage(proc=-1, interval=.1, timeout=None, timestamps=False,
405405

406406
# Write children to the stream file
407407
if multiprocess:
408-
for idx, chldmem in enumerate(_get_child_memory(proc.pid)):
408+
for idx, chldmem in enumerate(_get_child_memory(proc)):
409409
stream.write("CHLD {0} {1:.6f} {2:.4f}\n".format(idx, chldmem, time.time()))
410410
else:
411411
# Create a nested list with the child memory
412412
if multiprocess:
413413
mem_usage = [mem_usage]
414-
for chldmem in _get_child_memory(proc.pid):
414+
for chldmem in _get_child_memory(proc):
415415
mem_usage.append(chldmem)
416416

417417
# Append the memory usage to the return value

0 commit comments

Comments
 (0)