-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Memory leak when opening images #7961
Comments
It looks like it thinks the errors might be coming from lines 192 and 700? Pillow/src/PIL/PngImagePlugin.py Lines 188 to 192 in 955c5da
Pillow/src/PIL/PngImagePlugin.py Lines 700 to 702 in 955c5da
|
If I increase the number of loops to 1000, I find that the memory drops down again at a certain point. Since it is not continuously increasing, I don't think it is a leak. You might like to read #7935, in particular #7935 (comment)
|
It would probably be good to add |
I added
I see line 1083 on my machine. This would be easier to discuss if the original image could be uploaded here.
If I test a WebP image with your above code, I again find that the memory drops down again at a certain point. |
This saved me a lot. I encountered a similar problem where I load HD images into memory (35MiB per Image), saw that the RAM quickly rose up to 1 GiB within short span of time. I solved this by assigning |
Are there any questions left in this thread, or has the information provided been helpful? |
Closing this issue as no feedback has been received. |
Hello!
I have not found a solution to this problem. If there was a decision, then I apologize in advance.
When opening images, the amount of memory is constantly increasing. The library somehow saves the open images. I'm opening an image in context.
Simulated leak:
Out:
It looks like a memory leak in the plugin PngImagePlugin.py
If there is a solution how to get around this problem in tasks where you have to open a lot of images?
I have previously encountered an error in Webp formats. The leak was in the WebPImagePlugin plugin. I solved this by changing the value of the variable HAVE_WEBPANIM (PIL._webp.HAVE_WEBPANIM) to False. But now I'm facing a problem in PngImagePlugin
The text was updated successfully, but these errors were encountered: