This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 925177f77d Drop references to TLS objects earlier
925177f77d is described below
commit 925177f77dc34ccb1632be7fbddc558f2e8da43a
Author: remm <[email protected]>
AuthorDate: Mon Jan 5 11:15:55 2026 +0100
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.
---
java/org/apache/tomcat/util/net/NioEndpoint.java | 1 +
webapps/docs/changelog.xml | 4 ++++
2 files changed, 5 insertions(+)
diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 7e22f6b31d..93af98040f 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1254,6 +1254,7 @@ public class NioEndpoint extends
AbstractNetworkChannelEndpoint<NioChannel,Socke
getSocket().close(true);
}
if (getEndpoint().running) {
+ getSocket().reset(null, null);
if (nioChannels == null || !nioChannels.push(getSocket()))
{
getSocket().free();
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 4b2cd6f374..3ce451a95d 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -111,6 +111,10 @@
Improve warnings when setting ciphers lists in the FFM code, mirrorring
the tomcat-native changes. (remm)
</fix>
+ <fix>
+ <bug>69910</bug>: Dereference TLS objects right after closing a socket
+ to improve memory efficiency. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Other">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]