Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.1 Final
-
None
-
None
-
Operating System: All
Platform: All
-
27477
Description
Struts File Upload uses DiskFileUpload which in turn uses DefaultFileItem whose getTempFile() method
calls File.deleteOnExit() which is known to leak memory in the native heap. With our web app running
in WebSphere on AIX it crashes (coredumps) within hours under a constant load. IBM is unable to fix
the problem as it is in the JVM code they license from Sun and they are not allowed to modify. This
means it exists in all JVMs. Please see http://
developer.java.sun.com/developer/bugParade/bugs/4513817.html
Noel Bergman is playing around with using PhantomReferences in order to avoid this problem.
Clearly File.deleteOnExit() must be avoided but I'm not sure that using the PhantomReferences isn't
going to have it's own problems. For example, won't temporary files be leaked with the JVM is stopped
and restarted?