The app was releasing memory normally in the code. The question was that we are running the workflow in sandbox (default in python sdk), so after each workflow execution, the memory increases indefinitely. After passthrought modules in workflow, the memory usage was normalized.
That is expected, modules don’t have to be reloaded for every workflow task