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

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


The following commit(s) were added to refs/heads/main by this push:
     new bf4c5e688b Drop references to TLS objects earlier
bf4c5e688b is described below

commit bf4c5e688b936e6add9e3d9bce7f3f3154f86590
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 27dab3ca15..6b12acd8d7 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -227,6 +227,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="Jasper">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to