File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -513,21 +513,22 @@ def _test_figure_leak():
513
513
from matplotlib import pyplot as plt
514
514
# Second argument is pause length, but if zero we should skip pausing
515
515
t = float (sys .argv [1 ])
516
+ p = psutil .Process ()
516
517
517
518
# 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
524
525
525
526
for _ in range (5 ):
526
527
fig = plt .figure ()
527
528
if t :
528
529
plt .pause (t )
529
530
plt .close (fig )
530
- growth = p .memory_full_info ().uss - mem
531
+ growth = p .memory_info ().rss - mem
531
532
532
533
print (growth )
533
534
You can’t perform that action at this time.
0 commit comments