-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
docker pillow memory leak #4364
Comments
You're talking about a WebP image leak, and the file you have attached is WebP, but the sample code mentions a JPG? It is also strange that your sample code uses an infinite loop. How many iterations does it take to show the leak? Since you're suggesting something as subtle as a problem in one environment but not another, could you be more specific about the linux Docker image you used? Where did you get the image from? What flavour of Linux? |
You shouldn't use |
Sorry, this shouldn't be related since the filename isn't changing during the loop. |
@radarhere this
|
Memory leaks with speed about 500 megabytes on 29000 iterations which is ≈17kb/it, the same as image file size. |
@homm I modify the WebPImagePlugin.py:43 like this "if _webp.HAVE_WEBPANIM:", thus delete the |
@homm When i modify the WebPImagePlugin.py:43, there is other question. Do you has a plan to solve the memory leak question. |
While I don't encourage this as a solution, be aware that you can get that effect without modifying the Pillow source code. from PIL import _webp, Image
_webp.HAVE_WEBPANIM = False
im = Image.open("Tests/images/hopper.webp") |
@homm thanks very much! Just take your suggestions, I modify my codes. Until now, it is ok! |
What did you do?
I run codes in docker and physical machine。
What did you expect to happen?
when i run codes in the docker, it is ok.
What actually happened?
In physical machine it is ok, but in the docker appears memory leak. When I debug, I find that the error is caused by the file WebPImagePlugin.py:60
self._decoder = _webp.WebPAnimDecoder(self.fp.read())
What are your OS, Python and Pillow versions?
The text was updated successfully, but these errors were encountered: