8000 imshow intermediate memory usage · Issue #6952 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content
imshow intermediate memory usage #6952
< 8000 div class="Box-sc-g0xbh4-0 lkyTpy">New issue
Closed as not planned
Closed as not planned
@LevN0

Description

@LevN0

On my machine, imshow uses 3.5 GB of RAM at peak during its plotting process for a 385 MB array, even if this array is already a float64. Nearly 10x the RAM required for just the data alone. Once the plot is finished, it goes significantly. Is this a bug, or is this just how it is?

I cannot simply downsample because I would like to show the user the image at its true size, but allow them to scroll around to different parts via the scrollbars. Is there any approach someone can suggest to do this without having to have 10x the RAM?

Here is a minimal example via pyplot that reproduces this issue exactly; I used task manager to measure the RAM usage.

`import matplotlib.pyplot as plt
import numpy as np

img = np.random.rand(3000, 16024, dtype='float64')
imgplot = plt.imshow(img)

plt.show()`

Python 2.7 and 3.4
matplotlib 1.5.1 (installed via pip)
Using tkagg backend.
Windows 7

Metadata

Metadata

Assignees

No one assigned

    Labels

    Difficulty: Mediumhttps://matplotlib.org/devdocs/devel/contribute.html#good-first-issuesPerformancestatus: closed as inactiveIssues closed by the "Stale" Github Action. Please comment on any you think should still be open.status: inactiveMarked by the “Stale” Github Action

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0