[ 
https://issues.apache.org/jira/browse/TS-3257?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14256028#comment-14256028
 ] 

Sudheer Vinukonda commented on TS-3257:
---------------------------------------

Trying the below patch on the host. Will monitor and update.

{code}
diff --git a/iocore/net/P_SSLNetVConnection.h b/iocore/net/P_SSLNetVConnection.h
index c481c8b..77a3034 100644
--- a/iocore/net/P_SSLNetVConnection.h
+++ b/iocore/net/P_SSLNetVConnection.h
@@ -155,10 +155,15 @@ public:
     this->handShakeHolder = this->handShakeReader->clone();
   }
   void free_handshake_buffers() {
-
-    this->handShakeReader->dealloc();
-    this->handShakeHolder->dealloc();
-    free_MIOBuffer(this->handShakeBuffer);
+    if (this->handShakeReader) {
+      this->handShakeReader->dealloc();
+    }
+    if (this->handShakeHolder) {
+      this->handShakeHolder->dealloc();
+    }
+    if (this->handShakeBuffer) {
+      free_MIOBuffer(this->handShakeBuffer);
+    }
     this->handShakeReader = NULL;
     this->handShakeHolder = NULL;
     this->handShakeBuffer = NULL;
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index 871c5a0..1c63002 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -815,6 +815,7 @@ SSLNetVConnection::free(EThread * t) {
   hookOpRequested = TS_SSL_HOOK_OP_DEFAULT;
   npnSet = NULL;
   npnEndpoint= NULL;
+  free_handshake_buffers();
 
   if (from_accept_thread) {
     sslNetVCAllocator.free(this);
{code}

> possible memory leak in v5.2.0
> ------------------------------
>
>                 Key: TS-3257
>                 URL: https://issues.apache.org/jira/browse/TS-3257
>             Project: Traffic Server
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 5.2.0
>            Reporter: Sudheer Vinukonda
>             Fix For: 5.3.0
>
>
> After running v5.2.0 over the weekend on one of our prod hosts, I've noticed 
> that the RES memory from top grew to 21g (the corresponding RES memory on a 
> v5.0 prod host is 10g). Looking at the memory dump, it seems that it might be 
> leaking 4K iobuffers. The memory dump shows as much as 10g of 4K buffers 
> allocated/in-use (on the corresponding v5 host, the 4k buffers are only at 
> 300MB level)
> {code}
> -bash-4.1$ sudo grep "memory/ioBufAllocator\[5\]" traffic.out 
>          9421979648 |         9421180928 |       4096 | 
> memory/ioBufAllocator[5]
>          9431416832 |         9429147648 |       4096 | 
> memory/ioBufAllocator[5]
>          9700900864 |         9692045312 |       4096 | 
> memory/ioBufAllocator[5]
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to