Memory leak when saving pyramid files
See original GitHub issueWhen I open a TIFF image using access='sequential'
and then save it using compression='jpeg'
memory is not released.
Minimal example to reproduce the issue (run passing a large image file path as first parameter:
#!/usr/bin/env python3
import sys
import pyvips
fpath = sys.argv[1]
i = 1
while True:
print('Iteration {}'.format(i))
with open(fpath, 'rb') as fh:
img = pyvips.Image.new_from_buffer(fh.read(), '', access='sequential')
img.tiffsave('/tmp/flush.tif', compression='jpeg', Q=90)
i += 1
You can observe memory constantly increasing until eventually the program crashes.
Note that if I don’t use sequential access, or JPEG compression, the memory is flushed as normal.
Issue Analytics
- State:
- Created 5 years ago
- Comments:52 (25 by maintainers)
Top Results From Across the Web
python-pyramid app memory is not releasing at all
How to solve this memory leak? What measures should I take to cleanup old session objects? Isn't session.close() is sufficient? or. Is it ......
Read more >Memory leak occurs when you transfer a file that is larger than ...
Memory leak occurs when you transfer a file that is larger than 5 megabytes (MB) in a conversation in Skype for Business. This...
Read more >Google Code Archive - Google Code
646, WontFix, memory leak in 1183 Type-Defect Priority-Low. 645, Duplicate, 1177 Float - Crash on save. Windows 7 64bit 4GB RAM Type-Defect Priority-Low....
Read more >Memory leak - Wikipedia
In computer science, a memory leak is a type of resource leak that occurs when a computer program incorrectly manages memory allocations in...
Read more >web.mit.edu/GRAPHICS/OldFiles/src/xv/CHANGELOG
(Alan Blanchard (alan@abraxas.mbt.washington.edu)) Bug Fix: Memory leak if '-ncols 0' on a > 1-bit display Change: In the Save window, moved 'File list' ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@workergnome track this
For anyone googling for how to deal with extracting the pages from large PDF files as images, this Issue got me on the right path. The cache doesn’t have to be disabled completely, just limited. Example script here.