Menu icon indicating copy to clipboard operation
Menu copied to clipboard

Memory leaks

Open probonopd opened this issue 3 years ago • 1 comments

Menu is leaking memory big time.

How can we analyze this?

So far I found out:

void findAppsInside(QStringList locationsContainingApps, QMenu *m_systemMenu,  QFileSystemWatcher *watcher);

leaks memory, especially (but not only) the icons that get set on the QActions. This can be seen by using Heaptrack.

  • What is the best way to fix this?
  • Do we need to refactor this functionality into a QObject?

Also, searching leaks a lot of memory. Unfortunately, this cannot be seen by using Heaptrack because Heaptrack stops profiling before we have a chance to operate the Search menu.

  • Why does Heaptrack profiling stop prematurely?

probonopd avatar Nov 05 '22 02:11 probonopd

GammaRay ("Meta Objects" tab) appears to suggest that each search creates QActions which never get deleted. Also every switch between windows with menus.

probonopd avatar Nov 05 '22 02:11 probonopd