Skip to content

Commit bf4c5e6

Browse files
committed
Drop references to TLS objects earlier
BZ69910 It should be safe to null TLS objects as soon as the socket is closed, which will improve garbage collection efficiency.
1 parent 276a104 commit bf4c5e6

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

java/org/apache/tomcat/util/net/NioEndpoint.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,6 +1254,7 @@ protected void doClose() {
12541254
getSocket().close(true);
12551255
}
12561256
if (getEndpoint().running) {
1257+
getSocket().reset(null, null);
12571258
if (nioChannels == null || !nioChannels.push(getSocket())) {
12581259
getSocket().free();
12591260
}

webapps/docs/changelog.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,10 @@
227227
Improve warnings when setting ciphers lists in the FFM code, mirrorring
228228
the tomcat-native changes. (remm)
229229
</fix>
230+
<fix>
231+
<bug>69910</bug>: Dereference TLS objects right after closing a socket
232+
to improve memory efficiency. (remm)
233+
</fix>
230234
</changelog>
231235
</subsection>
232236
<subsection name="Jasper">

0 commit comments

Comments
 (0)