Comments (4)
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
from pillow.
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)
Pillow's memory allocator doesn't necessarily release the memory in the pool back as soon as an image is destroyed, as it uses that memory pool for future allocations. See Storage.c (https://github.com/python-pillow/Pillow/blob/main/src/libImaging/Storage.c#L310) for the implementation.
from pillow.
If I increase the number of loops to 1000, I find that the memory drops down again at a certain point.
It would probably be good to add gc.collect()
(import gc
) to the end of each loop. It might just not be running that often.
from pillow.
It would probably be good to add gc.collect() (import gc) to the end of each loop. It might just not be running that often.
I added gc.collect()
in, but it doesn't make an obvious difference.
It looks like it thinks the errors might be coming from lines 192 and 700?
I see line 1083 on my machine. This would be easier to discuss if the original image could be uploaded here.
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.
If I test a WebP image with your above code, I again find that the memory drops down again at a certain point.
from pillow.
Related Issues (20)
- Image CMS modes HOT 5
- 'PhotoImage' object has no attribute '_PhotoImage__photo' depending on img extension and argument/object HOT 2
- Some unpackers are misnamed HOT 5
- `py.typed` present, but not all methods have types HOT 3
- UnidentifiedImageError opening simple PSD using shapes and masks HOT 7
- Unable to install Pillow on M1 Mac (Clang error) HOT 12
- Add support for Ultra HDR
- Error saving and loading TIFF with exif with version>10.1 HOT 3
- Add Codecov token to python-pillow org HOT 3
- Question on Little-CMS dependency version HOT 2
- ImportError HOT 7
- Is this MPO file decoded correctly? HOT 16
- Feature request: Update pillow to import as pillow and follow PEP-8 naming conventions HOT 2
- Saving a CMYK image as .jp2/.j2k fails HOT 1
- Animated GIFs in Safari HOT 2
- Why do Pillow's wheels put shared objects in the non-standard `.dylibs` directory on macOS (and thereby break code-signing without tons of additional support code)? HOT 5
- RGBA PNG saved as PDF renders incorrectly in some applications HOT 19
- Python 3.13 not supported HOT 5
- Release Pillow 10.4.0 on July 1, 2024
- Neither Python 3.13.0b nor Python 3.14 works with Pillow HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pillow.