Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: GPU memory leak with plt.figure() #22448

Open
@patrickhaoy

Description

@patrickhaoy

Bug summary

There seems to be a GPU memory leak when callingplt.figure() andplt.close() repeatedly in matplotlib version3.5.0. Every time these two lines are ran, more and more GPU memory gets hogged up.

Code for reproduction

frommatplotlibimportpyplotaspltforiinrange(10000):plt.figure()plt.close()

Actual outcome

When inspecting memory usage, more and more GPU memory gets hogged up. Specifically, I rannvidia-smi -l 1 and observed Memory-Usage increasing until it hits the GPU memory limits, which is when the process crashes.

Expected outcome

GPU memory usage should not be going up every iteration of this for loop.

Additional information

This is an issue in matplotlib version3.5.0, but not3.0.3.

Operating system

Ubuntu

Matplotlib Version

3.5.0

Matplotlib Backend

TkAgg

Python version

3.9.10

Jupyter version

6.4.8

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp