From 89558e62371f404bf0ea58cc11a4573334bd8ec5 Mon Sep 17 00:00:00 2001 From: Anthony Geay Date: Wed, 1 Apr 2020 16:59:37 +0200 Subject: [PATCH] Reduce memory peak --- src/runtime/PythonNode.cxx | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/runtime/PythonNode.cxx b/src/runtime/PythonNode.cxx index 0227c2adf..79382d90c 100644 --- a/src/runtime/PythonNode.cxx +++ b/src/runtime/PythonNode.cxx @@ -460,7 +460,7 @@ void PythonNode::executeRemote() // Execute in remote Python node //=========================================================================== DEBTRACE( "-----------------starting remote python invocation-----------------" ); - Engines::pickledArgs_var resultCorba; + Engines::pickledArgs *resultCorba(nullptr); try { //pass outargsname and dict serialized @@ -478,15 +478,16 @@ void PythonNode::executeRemote() //=========================================================================== // Get results, unpickle and put them in output ports //=========================================================================== - char *resultCorbaC=new char[resultCorba->length()+1]; - resultCorbaC[resultCorba->length()]='\0'; - for(int i=0;ilength();i++) - resultCorbaC[i]=resultCorba[i]; - + auto length(resultCorba->length()); + char *resultCorbaC=new char[length+1]; + for(int i=0;ilength()); + PyObject* resultPython=PyBytes_FromStringAndSize(resultCorbaC,length); delete [] resultCorbaC; args = PyTuple_New(1); PyTuple_SetItem(args,0,resultPython); -- 2.39.2