Affects Version/s: 1.0 Final
Fix Version/s: None
Operating System: Windows 2000
Use FileUpload library in a servlet implementation for multipart request
Launch stress test in order to submit a lot of Post Http request with many
parameters and file to upload.
Environment: Windows (2000 or XP) with Sun JVM or IBM JVM 1.4.x
After few hours the server crash with an out of memory exception.
The HeapDump of the jvm at the crash time shows that a lot of memory is still
available in the java heap.
This out of memory is due to an out of memory of the java native heap.
Sample of exception message:
[Signaling in VM: java/lang/OutOfMemoryError, message:
JVMCI015:OutOfMemoryError, cannot create anymore threads due to memory or
Cause and solution:
The problem seems to be due to the File.deleteOnExit() call used in the
This call is used in order to delete temporary file at the exit of the JVM.
This call seems to create memory leak in native heap on Windows OS (We didn't
test it on Linux or Unix)
Moreover this is not usefull to let file destruction on exit of the jvm on a
In order to delete temporary file created by DefaultFileItem, a cleanup method
should be added,
or a cleanup of the temporary files should be provided, but not the