Closed rainman110 closed 4 months ago
created branch 261-possible-memory-leak-in-findgttask
to address this issue
mentioned in commit 2ad4a1d7391df0423dbc5319aed193d3abccf719
mentioned in commit 733eece5ab5a815bc5526f0b78e96ecdaf6b4fa8
mentioned in commit 292a063f5755ea414edd27b08b6a5230af8fed48
mentioned in commit 27753ee31c1b100512c9624eab374b81f106ae53
In GitLab by @jensschmeink on Apr 25, 2024, 07:23
mentioned in commit 9e2fa40cbebff9d52c1ba11ab613fe6d815af05c
This bug was discovered by @haes_ja during a real world GTlab session, where the memory increased to more than 30 GB RAM:
Calling
findGtTask
in a loop for a large task results in a temporary memory increase inside a python task.This memory is freed, when the python task has finished. The memory increase though is very large and unacceptable.
A quick analysis shows, that the function creates a copy of the task and appends it to the python task, see https://gitlab.dlr.de/at-twk/gtlab-python-module/-/blame/1-0-8/src/module/utilities/gtpy_processdatadistributor.cpp#L52. Hence the python task becomes larger and larger during its runtime.
My suggestion: don't append it to the python task but return the ownership of the task to python instead.
@marvinoe21 What is the intention to add the temporary copies to the python task? Just, to keep ownership at the C++ side?