poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 59166] util TempFile could cause memory leak
Date Fri, 17 Jun 2016 09:53:39 GMT

Javen O'Neal <onealj@apache.org> changed:

           What    |Removed                     |Added
             Status|NEEDINFO                    |RESOLVED
         Resolution|---                         |WONTFIX

--- Comment #3 from Javen O'Neal <onealj@apache.org> ---
None of the POI unit tests run long enough to experience the problems you're
experiencing. While we could register just the directory for deletion on JVM
exit, this strategy seems dangerous if the directory was not empty before
starting or a separate application wrote data to the directory. Under these
conditions, data loss could occur.

Another strategy for long-running processes is to keep a fixed-length queue of
files and delete the files FIFO as the queue overflows.
This would mean not registering deleteOnExit with the JVM, so you would need to
intercept a JVM exit message to delete the files remaining in the queue before
the JVM shut down.

You could also implement a strategy that deletes all temp files that have been
created. This is essentially the same as above using a variable-length set that
never implicitly deletes files.

I don't think any of these strategies are safe enough to implement without
getting into trouble: either leaving temp files behind or accidentally deleting
files that shouldn't have been deleted. If you have a better
TempFileCreationStrategy that would appeal to many users, feel free to re-open
this bug with the corresponding patch.

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org

View raw message