Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
bigger warmup for leak test
  • Loading branch information
richardsheridan committed Apr 8, 2022
commit a1f2e5ff919031bdb4d2aa272459d6dc5b474830
15 changes: 8 additions & 7 deletions lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,21 +513,22 @@ def _test_figure_leak():
from matplotlib import pyplot as plt
# Second argument is pause length, but if zero we should skip pausing
t = float(sys.argv[1])
p = psutil.Process()

# Warmup cycle, this reasonably allocates a lot
p = psutil.Process()
fig = plt.figure()
if t:
plt.pause(t)
plt.close(fig)
mem = p.memory_full_info().uss
for _ in range(2):
fig = plt.figure()
if t:
plt.pause(t)
plt.close(fig)
mem = p.memory_info().rss

for _ in range(5):
fig = plt.figure()
if t:
plt.pause(t)
plt.close(fig)
Comment thread
QuLogic marked this conversation as resolved.
growth = p.memory_full_info().uss - mem
growth = p.memory_info().rss - mem

print(growth)

Expand Down