+void PythonNode::squeezeMemorySafe()
+{
+ AutoGIL agil;
+ if(_mode==PythonNode::REMOTE_NAME)
+ this->squeezeMemoryRemote();
+ else
+ this->squeezeMemory();
+}
+
+void PythonNode::squeezeMemory()
+{
+ for(auto p : _setOfInputPort)
+ {
+ PyDict_DelItemString(_context,p->getName().c_str());
+ InputPyPort *p2(static_cast<InputPyPort *>(p));
+ if(p2->canSafelySqueezeMemory())
+ p2->put(Py_None);
+ }
+ for(auto p : _setOfOutputPort)
+ {
+ PyDict_DelItemString(_context,p->getName().c_str());
+ OutputPyPort *p2(static_cast<OutputPyPort *>(p));
+ p2->putWithoutForward(Py_None);
+ }
+}
+
+void PythonNode::squeezeMemoryRemote()
+{
+ for(auto p : _setOfInputPort)
+ {
+ InputPyPort *p2(static_cast<InputPyPort *>(p));
+ if(p2->canSafelySqueezeMemory())
+ p2->put(Py_None);
+ }
+ for(auto p : _setOfOutputPort)
+ {
+ OutputPyPort *p2(static_cast<OutputPyPort *>(p));
+ p2->putWithoutForward(Py_None);
+ }
+}
+