Qt Signal/Slot connections cause increase in CPU usage of application?

892 views Asked by At

I have a GUI application developed in Qt for a embedded system, I have many signal/slot Qt::queuedconnections present in my application. After running my application over a long period of time I am observing that the CPU usage of my system is linearly increasing over period of time, which is causing my application to respond slower.

Am not disconnecting these signal/slots connections. The increase in CPU usage is anywhere related to dynamically creating signal/slots ? Is there any method or way to test the signal/slot memory or CPU usage. ?

3

There are 3 answers

0
Thomas Ayoub On

I doubt the slow comes from you Signals/Slots since (quoted from the doc):

A signal-slot connection is removed when either of the objects involved are destroyed.

0
Sudz On

Some event(the paintevent for example) might be getting called in a loop, which leads to increase in CPU usage. Check if any event is associated with the "connections". Like other answers above, signal/slots do not lead to increase in CPU usage.

0
user12345 On

It was a memory leak problem, and not related to the signal/slot connections as I suspected. I figured it out using valgrind.