lingua-franca
lingua-franca copied to clipboard
Fix memory leak in unfederated execution
Similar to the memory leak issue in federated execution, the reference counts for some PyObjects are not being appropriately managed. In the case for unfederated execution, when the reaction that takes an input and schedules an action with the value of that input, it increases the reference count of self->_lf_inp->value, which is unnecessary.
Initialization:
After execution for 20 rounds, the memory usage increased to 10GBs:
The segfault with src/DelayArrayWithAfter.lf
indicates that the leak is because of a failure to decrement the reference count at the right point rather than an extra increment of the reference count. Perhaps the reference count for the value needs to be decremented in generateForwardBody
?
Could this be related to #2082?