Affects Version/s: 1.0, 1.1, 1.2, 1.3, 1.3.1, 1.3.2, 1.4, 2.0, 3.x
Fix Version/s: 2.0
Using commons-io-1.4 via commons-fileupload-1.1.1 in Apache Tomcat/5.5.0 on Java 1.6.
When subjected to heavy load, the performance of org.apache.commons.io.FileCleaningTracker degrades and becomes a bottleneck to the system. In our case, we had over 2 millions entries on the "trackers" Vector. Under these conditions, the call to trackers.remove(tracker) on line 214 becomes very inefficient as it causes the Vector to shift and reindex the remaining data. In addition, calls to trackers.add are forced to wait on the inefficient remove operation. With the application idle, it took several hours for the File Reaper thread to finish processing the entries on the trackers Vector.
The solution for use was to implement trackers as a HashSet instead of a Vector. Thus line 52 was changed from:
final Collection /* Tracker */ trackers = new Vector(); // synchronized
final Collection /* Tracker */ trackers = Collections.synchronizedSet(new HashSet()); // synchronized
Imports were also change appropriately.
|Transition||Time In Source Status||Execution Times||Last Executer||Last Execution Date|
|284d 4h 4m||1||Niall Pemberton||04/Aug/10 01:37|
|463d 17h 32m||1||Henri Yandell||10/Nov/11 18:09|
|Status||Resolved [ 5 ]||Closed [ 6 ]|
|Workflow||jira [ 12480312 ]||Default workflow, editable Closed status [ 12601847 ]|
|Field||Original Value||New Value|
|Status||Open [ 1 ]||Resolved [ 5 ]|
|Assignee||Niall Pemberton [ niallp ]|
|Fix Version/s||2.0 [ 12312961 ]|
|Resolution||Fixed [ 1 ]|