Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Process generation issue @ Qt 5.7.1. / Heavy resource load
Forum Updated to NodeBB v4.3 + New Features

Process generation issue @ Qt 5.7.1. / Heavy resource load

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
5 Posts 3 Posters 745 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Q Offline
    Q Offline
    qtcat
    wrote on last edited by
    #1

    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

    aha_1980A jsulmJ 2 Replies Last reply
    0
    • Q qtcat

      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

      aha_1980A Offline
      aha_1980A Offline
      aha_1980
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @qtcat

      Why is Qt creating so much processes, with that minimal code? is this intentional?

      No, it isn't (for both questions).

      Are you sure that is the code you deployed to the PI?

      Qt has to stay free or it will die.

      1 Reply Last reply
      1
      • Q Offline
        Q Offline
        qtcat
        wrote on last edited by
        #3

        Yes, im sure. I checked it via htop.

        aha_1980A 1 Reply Last reply
        0
        • Q qtcat

          Yes, im sure. I checked it via htop.

          aha_1980A Offline
          aha_1980A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @qtcat The code you showed us so far, creates one process.

          You will need to give more information about how you start that process. Probably the app is started several times?

          Regards

          Qt has to stay free or it will die.

          1 Reply Last reply
          1
          • Q qtcat

            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

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @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...

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            1

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved