Geotoolkit

Reduce the use of File.deleteOnExit()

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 3.00
  • Fix Version/s: 3.03
  • Component/s: Utilities
  • Labels:
    None

Description

File.deleteOnExit() stores the file path for the whole JVM lifetime. If this method is invoked extensively, memory usage on a server will increase indefinitly. A possible replacement would be to write our own TemporaryFiles manager which delete the files when the object that use them is garbage collected. That would be sooner than waiting for the JVM shutdown. Note that this is only a safety in case the object which created the temporary file has not been properly disposed (e.g. by a call to ImageReader.dispose().

Activity

Hide
Martin Desruisseaux added a comment - 05/Aug/2009 16:52

Added a org.geotoolkit.internal.io.TemporaryFile class for tracking temporary files.

Show
Martin Desruisseaux added a comment - 05/Aug/2009 16:52 Added a org.geotoolkit.internal.io.TemporaryFile class for tracking temporary files.

People

Vote (0)
Watch (0)

Dates

  • Created:
    05/Jun/2009 15:33
    Updated:
    05/Aug/2009 16:52
    Resolved:
    05/Aug/2009 16:52

Time Tracking

Estimated:
4h
Original Estimate - 4 hours
Remaining:
4h
Remaining Estimate - 4 hours
Logged:
Not Specified
Time Spent - Not Specified