8000 bigger warmup for leak test · matplotlib/matplotlib@a1f2e5f · GitHub
[go: up one dir, main page]

Skip to content

Commit a1f2e5f

Browse files
bigger warmup for leak test
1 parent b59a89e commit a1f2e5f

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -513,21 +513,22 @@ def _test_figure_leak():
513513
from matplotlib import pyplot as plt
514514
# Second argument is pause length, but if zero we should skip pausing
515515
t = float(sys.argv[1])
516+
p = psutil.Process()
516517

517518
# Warmup cycle, this reasonably allocates a lot
518-
p = psutil.Process()
519-
fig = plt.figure()
520-
if t:
521-
plt.pause(t)
522-
plt.close(fig)
523-
mem = p.memory_full_info().uss
519+
for _ in range(2):
520+
fig = plt.figure()
521+
if t:
522+
plt.pause(t)
523+
plt.close(fig)
524+
mem = p.memory_info().rss
524525

525526
for _ in range(5):
526527
fig = plt.figure()
527528
if t:
528529
plt.pause(t)
529530
plt.close(fig)
530-
growth = p.memory_full_info().uss - mem
531+
growth = p.memory_info().rss - mem
531532

532533
print(growth)
533534

0 commit comments

Comments
 (0)
0