Process generation issue @ Qt 5.7.1. / Heavy resource load
-
Hi there,
i build a Qt Application (using QApplication) in C++ on the Raspberry Pi 3.It displays a rectangular window with 8 buttons.
Each button triggers an unique function.These functions primarily consist of a fork() statement,
deciding what process id the new process is on, and sending a SIGTERM after Parents (do nothing) and Childs (print, beep, execute browser via system call, etc) task.Everything is working - the problem is, that if i push the putton multiple times, the system is getting less responsive. I used htop to analyze, and i saw that i got multiple tasks (=6) of my application running.
Every time i press on the button, it adds one more processes and the Pi slows down until i have to sigkill manually..At first i thought of mistakes handling the fork(), so i i reduced my code as far as this, and the problem still remains with 5 Processes.
-------------------main.cpp-------------------------------
#include <QApplication>
int main(int argc, char* argv[])
{
QApplication a(argc, argv);
for (;;) {} //hold it running, for counting processes in htop
}
------------------main.cpp-------------------------------Why is Qt creating so much processes, with that minimal code? is this intentional?
Im running:
QMake version 3.0
Using Qt version 5.7.1. in /usr/lib/arm-linux-gnueabihf -
@qtcat said in Process generation issue @ Qt 5.7.1. / Heavy resource load:
Every time i press on the button, it adds one more processes
You should show your real code...
Qt itself does not start any processes, it can create additional threads but not processes.
So, please show your code, else we can only guess...