-
Bug
-
Resolution: Done
-
Critical
-
3.0.19.Final
-
None
Issue to reopen RESTEASY-773
Usage of the multipart provider causes a memory leak as the underlying mime4j implementation uses the File#deleteOnExit hook in the class TempFileStorageProvider:
public StorageOutputStream createStorageOutputStream() throws IOException { File file = File.createTempFile(prefix, suffix, directory); file.deleteOnExit(); return new TempFileStorageOutputStream(file); }
The JDK keeps a set of File references (even when already deleted) in memory until teh JVM exists. Long-running server libarreis should never use File::deleteOnExit()
https://bugs.openjdk.java.net/browse/JDK-4872014
https://bugs.openjdk.java.net/browse/JDK-4513817
class DeleteOnExitHook { private static LinkedHashSet<String> files = new LinkedHashSet<>();
- relates to
-
RESTEASY-1596 Memory leak do to jdk File.deleteOnExit in DataSourceProvider
- Closed
-
RESTEASY-1597 Memory leak due to File.deleteOnExit in ApacheHttpClient4Engine
- Closed
- links to