-
Bug
-
Resolution: Fixed
-
P4
-
8, 11, 14
-
b23
-
x86_64
-
windows_10
-
Not verified
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8257426 | 13.0.6 | Yuri Nesterenko | P4 | Resolved | Fixed | b02 |
JDK-8249960 | 11.0.10-oracle | Michael McMahon | P4 | Resolved | Fixed | b01 |
JDK-8247791 | 11.0.9 | Michael McMahon | P4 | Resolved | Fixed | b01 |
A DESCRIPTION OF THE PROBLEM :
We have a system that posts lots of (potentially) large messages via HTTPS using a HttpsURLConnections. The underlying HttpURLConnection implementation holds the transmitted data in internal buffers after posting with no way for us to clear them. Normally this would not be an issue because when we release our HttpsURLConnection references the objects would be garbage collected. Unfortunately HttpsURLConnectionImpl exposes a finalizer and so when our system is under load we find that the objects build up in the finalization queue which is only cleared by a low priority thread that does not get to run due to the increased load caused by the garbage collection overhead caused by the low memory state. This then becomes a vicious circle causing the system to become extremely unstable. There have been many bugs raised relating to this area raised in the past, eg: https://bugs.openjdk.java.net/browse/JDK-6869672 and its associated related bugs. The underlying issue of the finalizer never seems to have been addressed but looking at the latest code:
sun.net.www.protocol.https.HttpsURLConnectionImpl has a finalizer which simply invokes sun.net.www.protocol.https.DelegateHttpsURLConnection.dispose(). This dispose method only invokes super.finalize(). There is no implementation of super.finalize() other than the empty implementation in java.lang.Object and so the finalizer has no purpose and should be removed.
We have a system that posts lots of (potentially) large messages via HTTPS using a HttpsURLConnections. The underlying HttpURLConnection implementation holds the transmitted data in internal buffers after posting with no way for us to clear them. Normally this would not be an issue because when we release our HttpsURLConnection references the objects would be garbage collected. Unfortunately HttpsURLConnectionImpl exposes a finalizer and so when our system is under load we find that the objects build up in the finalization queue which is only cleared by a low priority thread that does not get to run due to the increased load caused by the garbage collection overhead caused by the low memory state. This then becomes a vicious circle causing the system to become extremely unstable. There have been many bugs raised relating to this area raised in the past, eg: https://bugs.openjdk.java.net/browse/JDK-6869672 and its associated related bugs. The underlying issue of the finalizer never seems to have been addressed but looking at the latest code:
sun.net.www.protocol.https.HttpsURLConnectionImpl has a finalizer which simply invokes sun.net.www.protocol.https.DelegateHttpsURLConnection.dispose(). This dispose method only invokes super.finalize(). There is no implementation of super.finalize() other than the empty implementation in java.lang.Object and so the finalizer has no purpose and should be removed.
- backported by
-
JDK-8247791 Memory retention due to HttpsURLConnection finalizer that serves no purpose
- Resolved
-
JDK-8249960 Memory retention due to HttpsURLConnection finalizer that serves no purpose
- Resolved
-
JDK-8257426 Memory retention due to HttpsURLConnection finalizer that serves no purpose
- Resolved