Qt refreshes at 60 FPS and eats GPU
I have a Qt app that starts refreshing at 60FPS, but I can't figure out why.
I have used the QML profiler and I do not see any event that triggers the redraw. Using:
QSG_RENDERER_DEBUG=debug
QSG_RENDER_TIMING=1
I see
Gui Thread: window = 0x7fffffffe400, polish = 0, lock = 0, block / sync = 15 - animation = 0
written very often. The message starts appearing at this rate a few seconds after starting without any action. Timing seems to be random - sometimes it starts after 5 seconds, sometimes after 15 seconds.
Using:
QSG_VISUALIZE=changes
I can see the whole screen is refreshed - the app is full screen.
I am using Qt 5.3 on Linux Debian 8, Kernel 4.91. This eats up about 25% of my NVIDIA 980. On Debian 8, Kernel 3.16, it consumes over 50% of the integrated Intel GPU.
Do you have any hints on how I can determine what is causing the update?
source to share
After uninstalling the app, I ended up with an old C ++ class that had this:
::paint()
{
...
update();
...
}
This created an infinite loop paint<->update
that didn't call stackoverflow just because they were running on different threads :)
The sheer coincidence arose from the fact that the C ++ object was used in multiple places from the QML code.
I don't know if this is relevant to the original question as it is a classic programming error not related to the Qt map.
source to share