CompoundDocument leaks a file descriptor
See original GitHub issueThe CompoundDocument
class uses a LittleEndianRandomAccessFile
internally to read the file contents:
https://github.com/haraldk/TwelveMonkeys/blob/24c6682236e5a02151359486aa4075ddc5ab1534/common/common-io/src/main/java/com/twelvemonkeys/io/ole2/CompoundDocument.java#L105
However, input.close()
is never called, which means that the underlying RandomAccessFile
can hold an open file descriptor indefinitely in a long-running process.
Is there any reason not to just add a CompoundDocument#close()
method?
Issue Analytics
- State:
- Created 5 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
File descriptor leaks on Linux - java - Stack Overflow
I have an application which leaks thousands of file descriptors. lsof shows many opened regular files, but in memory dump of the application ......
Read more >CWE-403: Exposure of File Descriptor to Unintended Control ...
While this issue is frequently called a file descriptor leak, the "leak" term is often used in two different ways - exposure of...
Read more >Is there a way to track leaking file descriptors?
Click on Filesystem Activity track on the top;; Click on Filesystem Statistics popup menu on the toolbar of details below;; Select File Descriptor...
Read more >VSMac leaks file descriptors which eventually leads to errors ...
When I tried to debug my app in the iOS simulator it showed an error message: "Could not register to wait for file...
Read more >Help solving an elusive file descriptor leak
This was caused by having only 4096 inotify handlers. I've increased the limits and the issue is gone. fs.file-max = 131070 ...
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
That seems to work. Tremendous, thanks for all your help!
Thanks for following up on this!
That does indeed seem to be the case. Which is even worse…
My own code (the
ThumbsDBImageReader
) only uses the constructor taking anImageInputStream
parameter. And I believe this one is safe, as long as you close theImageInputStream
instance (which you can do externally).Something like:
This could perhaps work as a workaround for you, until I get the issue fixed.
Best regards,
– Harald K