diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2020-06-13 14:17:10 +0200 |
---|---|---|
committer | Milian Wolff <milian.wolff@kdab.com> | 2020-09-11 10:30:50 +0000 |
commit | 38829bdee03b953e1250b5a675c96790843e9666 (patch) | |
tree | 797d87e3d9250ff3e07034f29f4cbbed957eb182 | |
parent | fdb22739980e188aadfa369881f50bf737e82c43 (diff) |
Free symbol table resources when a process exists
For perf.data files that span many (small) processes, we held on
to the symbol tables even after a process exited. This wastes
resources and can even lead to potential confusion when a PID is
recycled - we would have reused the symbol table from the last
process then, which could be a completely different one.
Change-Id: I858dce578619191babdd1a8410ad038c0b686ff6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r-- | app/perfunwind.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/app/perfunwind.cpp b/app/perfunwind.cpp index e277191..44ad704 100644 --- a/app/perfunwind.cpp +++ b/app/perfunwind.cpp @@ -957,6 +957,8 @@ void PerfUnwind::flushEventBuffer(uint desiredBufferSize) const auto childPid = taskEventIt->m_pid; const auto parentPid = taskEventIt->m_payload; symbolTable(childPid)->initAfterFork(symbolTable(parentPid)); + } else if (taskEventIt->m_type == ThreadEnd && taskEventIt->m_pid == taskEventIt->m_tid) { + delete m_symbolTables.take(taskEventIt->m_pid); } sendTaskEvent(*taskEventIt); |