Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
analysis: Fix resource leak in CompositeHostModel
The original design had some flaws: - The CompositeHostModel is instantiated in many cases, for example when a kernel analysis module is created. But it is only disposed from ModelManager when an InstrumentedCallStackAnalysis is disposed, which only happens if a LTTng UST trace is opened in the experiment. Therefore the CompositeHostModel leaks when opening a single LTTng kernel trace. - When the InstrumentedCallStackAnalysis is disposed, all models are disposed, regardless of whether the models are still in use by another opened trace. - The CompositeHostModel is disposed, deregistering itself from the signal manager, before it has had time to handle the TmfTraceClosed signal, which means this signal handler's cleanup tasks are not done. The implemented fix implements these changes: - Remove the responsibility from InstrumentedCallStackAnalysis to dispose the models. - Add the responsibility to CompositeHostModel itself, in the TmfTraceClosed signal handler, to dispose all models, but only if there are no remaining opened traces. This means the models remain in memory when other traces are still opened, whether they are associated with these traces or not. Change-Id: I2fb8c836c5498266b757b115466be13d8e02b05d Signed-off-by: Patrick Tasse <patrick.tasse@gmail.com> Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/202404 Tested-by: Trace Compass Bot <tracecompass-bot@eclipse.org> Tested-by: Matthew Khouzam <matthew.khouzam@ericsson.com> Reviewed-by: Matthew Khouzam <matthew.khouzam@ericsson.com> (cherry picked from commit c92ebcc) Reviewed-on: https://git.eclipse.org/r/c/tracecompass/org.eclipse.tracecompass/+/201994
- Loading branch information