[
https://issues.apache.org/jira/browse/FILEUPLOAD-181?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13598253#comment-13598253
]
Thomas Neidhart commented on FILEUPLOAD-181:
--------------------------------------------
DiskFileItem has a finalize method which cleans up the temporary file.
When a DiskFileItem is created by the DiskFileItemFactory, its temporary file
is also registered with the FileCleaningTracker, if one is available. In this
case the finalize is a duplication of effort and unneeded.
The question is how can we ensure that the file gets deleted when no tracker is
defined?
Define a default tracker that takes care of it?
> finalize method substitution
> ----------------------------
>
> Key: FILEUPLOAD-181
> URL: https://issues.apache.org/jira/browse/FILEUPLOAD-181
> Project: Commons FileUpload
> Issue Type: Improvement
> Affects Versions: 1.2.2
> Reporter: Oscar Gonzalez
>
> As some java.sun.com articles recommends, the finalize method should be
> substituted to improve memory management.
> In heavy load environment, with many upload executions, the use of finalize
> method may cause OutOfMemoryErrors because of low priority of FinalizerThread.
> See http://www.fasterj.com/articles/finalizer1.shtml and
> http://www.fasterj.com/articles/finalizer2.shtml
> See http://java.sun.com/developer/technicalArticles/javase/finalization/ to
> see an alternative
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira