Issue Details (XML | Word | Printable)

Key: FILEUPLOAD-48
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Sandra Grenier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons FileUpload

[fileupload] Memory leak in DefaultFileItem

Created: 08/Apr/05 11:09 PM   Updated: 09/Mar/07 08:31 PM
Return to search
Component/s: None
Affects Version/s: 1.0 Final
Fix Version/s: None

Time Tracking:
Not Specified

Environment:
Operating System: Windows 2000
Platform: PC

Bugzilla Id: 34373


 Description  « Hide
Scenario:
Use FileUpload library in a servlet implementation for multipart request
parsing.
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

Problem:
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
resource constraints]

Cause and solution:
The problem seems to be due to the File.deleteOnExit() call used in the
DefaultFileItem class.
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
server.
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
File.deleteOnExit() method.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.