You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by hz...@apache.org on 2017/05/31 23:34:55 UTC

[2/3] incubator-trafodion git commit: [TRAFODION-2625] Memory "leak" for large TMUDFs

[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 <hz...@apache.org>
Authored: Tue May 30 16:04:36 2017 +0000
Committer: Hans Zeller <hz...@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