This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 8bd2d75ed4 Drop references to TLS objects earlier
8bd2d75ed4 is described below

commit 8bd2d75ed4aee06ae3eef00f5e1f04d91091f0a2
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 1bd06dd456..b20257e80b 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1303,6 +1303,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint<NioChannel,SocketChannel>
                     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 70bee5509b..7bb509b44a 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -114,6 +114,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]

Reply via email to