trafodion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hzel...@apache.org
Subject [2/3] incubator-trafodion git commit: [TRAFODION-2625] Memory "leak" for large TMUDFs
Date Wed, 31 May 2017 23:34:55 GMT
[TRAFODION-2625] Memory "leak" for large TMUDFs

This is not a leak in the strict sense, as the memory gets deallocated
once the UDF finishes, but for UDFs that read or produce many rows, we
need to call method IpcBufferedMsgStream::cleanupBuffers() while the
UDF is executing. Otherwise, none of the reply buffers used will be
deallocated until the end. I've seen up to 20 GB of buffers being held
that way.


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/commit/18edb527
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/tree/18edb527
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafodion/diff/18edb527

Branch: refs/heads/master
Commit: 18edb52790571842c7d159e3fe38925755c93632
Parents: 84abd5c
Author: Hans Zeller <hzeller@apache.org>
Authored: Tue May 30 16:04:36 2017 +0000
Committer: Hans Zeller <hzeller@apache.org>
Committed: Tue May 30 16:04:36 2017 +0000

----------------------------------------------------------------------
 core/sql/udrserv/udrserv.cpp | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafodion/blob/18edb527/core/sql/udrserv/udrserv.cpp
----------------------------------------------------------------------
diff --git a/core/sql/udrserv/udrserv.cpp b/core/sql/udrserv/udrserv.cpp
index fa84d01..fef9d4d 100644
--- a/core/sql/udrserv/udrserv.cpp
+++ b/core/sql/udrserv/udrserv.cpp
@@ -2850,6 +2850,9 @@ Int32 PerformWaitedReplyToClient(UdrGlobals *UdrGlob,
 
   sendDataReply(UdrGlob, msgStream, NULL);
 
+  // cleanup no longer used buffers
+  msgStream.cleanupBuffers();
+
   //Note down the current sp so that we can restore it back
   //once ProcessARequest() call is complete. There are scenarios
   //in ProcessARequest to reset spInfo in udrGlobals once Spinfo


Mime
View raw message