RFR: 8168640: (fc) Avoiding AtomicBoolean in FileInput/-OutputStream improves startup

Claes Redestad claes.redestad at oracle.com
Tue Oct 25 10:51:01 UTC 2016


Hi,

in https://bugs.openjdk.java.net/browse/JDK-8025619 the logic for 
closing a FileInputStream was changed from a volatile boolean + lock to 
use an AtomicBoolean with rather benign effect on startup - up until the 
point where VarHandles was integrated, which now means we're 
transitively initializing ~20 VarHandle-related classes and perform a 
non-trivial amount of initialization during VM initialization.

Avoiding AtomicBoolean improves startup and footprint for a sample of 
small applications:

Webrev: http://cr.openjdk.java.net/~redestad/8168640/webrev.01/
Bug: https://bugs.openjdk.java.net/browse/JDK-8168640

Testing: passing all File and VarHandle tests locally, running a larger 
suite of tests on a wider set of platforms with no issues so far.

Thanks!

/Claes



More information about the core-libs-dev mailing list