-
Enhancement
-
Resolution: Fixed
-
P5
-
1.4.0, 5.0, 6
-
b63
-
generic, x86
-
generic, linux
File.deleteOnExit() uses the JVM entry point JVM_OnExit to register an at-exit
cleanup hook. It currently does not use the shutdown hooks mechanism introduced
in 1.3 because the API predates shutdown hooks. Unfortunately it turns out that
due to implementation details these two mechanisms are not orthogonal; in order
for the JVM at-exit hooks to be called, shutdown hooks need to be initialized.
Specifically, Terminator.setup() needs to be called during core libraries
startup.
A better solution which would reduce the amount of core libraries initialization
would be to reimplement File.deleteOnExit() to use shutdown hooks. This would
delay the first call to Terminator.setup() until actually required by the
application.
cleanup hook. It currently does not use the shutdown hooks mechanism introduced
in 1.3 because the API predates shutdown hooks. Unfortunately it turns out that
due to implementation details these two mechanisms are not orthogonal; in order
for the JVM at-exit hooks to be called, shutdown hooks need to be initialized.
Specifically, Terminator.setup() needs to be called during core libraries
startup.
A better solution which would reduce the amount of core libraries initialization
would be to reimplement File.deleteOnExit() to use shutdown hooks. This would
delay the first call to Terminator.setup() until actually required by the
application.
- duplicates
-
JDK-4813777 File.deleteOnExit() should only remember each pathname once
- Closed
- relates to
-
JDK-6831947 (file) deleteOnExit throws unspecified IllegalStateException and/or runs concurrently with mutators
- Closed
-
JDK-4513817 File.deleteOnExit consumes memory
- Closed
-
JDK-4805381 File.deleteOnExit does not work when program is interrupted (^C)
- Closed
-
JDK-6920451 File.deleteOnExit should make it clear that Runtime.halt does not require deletions to be attempted
- Closed