Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. A project build on Raspbian.
Forum Updated to NodeBB v4.3 + New Features

A project build on Raspbian.

Scheduled Pinned Locked Moved Unsolved General and Desktop
23 Posts 6 Posters 2.7k Views 2 Watching
  • 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.
  • J Offline
    J Offline
    jenya7
    wrote on last edited by
    #1

    Once in a while (about 3-5 builds) the OS totally "freezes " and I have to restart the machine. Any suggestions? Seems like some memory is not freed and I get a stack overflow or something.

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      If you are building with all cores, try keeping one idle (make -j 3 instead of make -j 4). This should lower the amount of RAM consumed by the compiler.

      (Z(:^

      J 1 Reply Last reply
      3
      • sierdzioS sierdzio

        If you are building with all cores, try keeping one idle (make -j 3 instead of make -j 4). This should lower the amount of RAM consumed by the compiler.

        J Offline
        J Offline
        jenya7
        wrote on last edited by jenya7
        #3

        @sierdzio
        I see. It is - 1.5 GHz 64-bit quad core ARM Cortex-A72 processor. Where I configure it "make -j 3"? Do I have access to a make file directly?

        I see. PARALLEL JOBS: 3.

        thank you. so far so good.

        jsulmJ 1 Reply Last reply
        1
        • J jenya7

          @sierdzio
          I see. It is - 1.5 GHz 64-bit quad core ARM Cortex-A72 processor. Where I configure it "make -j 3"? Do I have access to a make file directly?

          I see. PARALLEL JOBS: 3.

          thank you. so far so good.

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

          @jenya7 said in A project build on Raspbian.:

          Where I configure it "make -j 3"

          When you call make

          make -j 4
          

          Do you compile in a terminal or in QtCreator?
          If in QtCreator then go to "Projects/Build/Build Steps" and set the number of parallel jobs.

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

          J 1 Reply Last reply
          1
          • jsulmJ jsulm

            @jenya7 said in A project build on Raspbian.:

            Where I configure it "make -j 3"

            When you call make

            make -j 4
            

            Do you compile in a terminal or in QtCreator?
            If in QtCreator then go to "Projects/Build/Build Steps" and set the number of parallel jobs.

            J Offline
            J Offline
            jenya7
            wrote on last edited by
            #5

            @jsulm
            Yes I did so. Now it's better but "freeze" occurs however.

            1 Reply Last reply
            0
            • JoeCFDJ Offline
              JoeCFDJ Offline
              JoeCFD
              wrote on last edited by JoeCFD
              #6

              It could be a Qt bug. Mine on Ubuntu freezes sometimes as well. It could also be the case that too many other apps are running. Try to build it from command line which looks even faster. Get into the build folder which you can find it from Qt creator and run the command: make -j3.

              I use qt creator only for editing and debugging. But compile from command line.

              1 Reply Last reply
              0
              • Christian EhrlicherC Offline
                Christian EhrlicherC Offline
                Christian Ehrlicher
                Lifetime Qt Champion
                wrote on last edited by
                #7

                Why should it be a Qt bug when the OS freezes because it has to swap out the memory / has memory pressure? A single gcc process will easily use 1GB when compiling Qt so don't execute that much gcc processes at the same time when you're low on memory.

                Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                Visit the Qt Academy at https://academy.qt.io/catalog

                JoeCFDJ 1 Reply Last reply
                1
                • Christian EhrlicherC Christian Ehrlicher

                  Why should it be a Qt bug when the OS freezes because it has to swap out the memory / has memory pressure? A single gcc process will easily use 1GB when compiling Qt so don't execute that much gcc processes at the same time when you're low on memory.

                  JoeCFDJ Offline
                  JoeCFDJ Offline
                  JoeCFD
                  wrote on last edited by JoeCFD
                  #8

                  @Christian-Ehrlicher No other app causes this. So it must be a qt bug. Even when it swaps memory, it should keep going. It simply freezes.

                  Christian EhrlicherC 1 Reply Last reply
                  0
                  • JoeCFDJ JoeCFD

                    @Christian-Ehrlicher No other app causes this. So it must be a qt bug. Even when it swaps memory, it should keep going. It simply freezes.

                    Christian EhrlicherC Offline
                    Christian EhrlicherC Offline
                    Christian Ehrlicher
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @JoeCFD said in A project build on Raspbian.:

                    So it must be a qt bug.

                    Did you really read my answer about the memory usage of a compiler instance? I guess not... there is nothing Qt (or in this case QtCreator...) can do about low memory or the memory usage of a compiler. When you spawn 4 processes which takes more than 1GB at least then you will have a hard time with only 4GB of RAM.

                    Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                    Visit the Qt Academy at https://academy.qt.io/catalog

                    JoeCFDJ 1 Reply Last reply
                    1
                    • Christian EhrlicherC Christian Ehrlicher

                      @JoeCFD said in A project build on Raspbian.:

                      So it must be a qt bug.

                      Did you really read my answer about the memory usage of a compiler instance? I guess not... there is nothing Qt (or in this case QtCreator...) can do about low memory or the memory usage of a compiler. When you spawn 4 processes which takes more than 1GB at least then you will have a hard time with only 4GB of RAM.

                      JoeCFDJ Offline
                      JoeCFDJ Offline
                      JoeCFD
                      wrote on last edited by
                      #10

                      @Christian-Ehrlicher BTW, how could build cause memory problem?

                      1 Reply Last reply
                      0
                      • JoeCFDJ Offline
                        JoeCFDJ Offline
                        JoeCFD
                        wrote on last edited by JoeCFD
                        #11

                        not sure if ctrl + alt + del works on Raspbian. If it works, you can kill qt creator or your project in case of debugging to avoid restart.
                        ctrl + alt + del works on Ubuntu to pop-up task manager.

                        1 Reply Last reply
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #12

                          Hi,

                          Building code can be very memory hungry depending on a lot independent things such as your actual code base, the number of libraries you use, the number of headers your include, the content of the headers you include, etc. Building is not just translating your text file to machine code.

                          Interested in AI ? www.idiap.ch
                          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                          JoeCFDJ 1 Reply Last reply
                          1
                          • SGaistS SGaist

                            Hi,

                            Building code can be very memory hungry depending on a lot independent things such as your actual code base, the number of libraries you use, the number of headers your include, the content of the headers you include, etc. Building is not just translating your text file to machine code.

                            JoeCFDJ Offline
                            JoeCFDJ Offline
                            JoeCFD
                            wrote on last edited by
                            #13

                            @SGaist Could be true. I just tested my app. With 4 threads, make uses about 10% of total memory. But my app needs more than that.

                            SGaistS 1 Reply Last reply
                            0
                            • JoeCFDJ JoeCFD

                              @SGaist Could be true. I just tested my app. With 4 threads, make uses about 10% of total memory. But my app needs more than that.

                              SGaistS Offline
                              SGaistS Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on last edited by
                              #14

                              @JoeCFD we don't know what the OP is trying to build so it could be completely at odds with regard to your own reference.

                              Interested in AI ? www.idiap.ch
                              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                              JoeCFDJ 1 Reply Last reply
                              0
                              • SGaistS SGaist

                                @JoeCFD we don't know what the OP is trying to build so it could be completely at odds with regard to your own reference.

                                JoeCFDJ Offline
                                JoeCFDJ Offline
                                JoeCFD
                                wrote on last edited by JoeCFD
                                #15

                                @SGaist True. I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                J Christian EhrlicherC 2 Replies Last reply
                                0
                                • JoeCFDJ JoeCFD

                                  @SGaist True. I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                  J Offline
                                  J Offline
                                  jenya7
                                  wrote on last edited by
                                  #16

                                  @JoeCFD said in A project build on Raspbian.:

                                  @SGaist True. I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                  How do I build from a command line?

                                  jsulmJ 1 Reply Last reply
                                  0
                                  • J jenya7

                                    @JoeCFD said in A project build on Raspbian.:

                                    @SGaist True. I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                    How do I build from a command line?

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

                                    @jenya7

                                    • Open a terminal
                                    • Create a build folder
                                    • Change into build folder
                                    • Call: qmake PATH_TO_PROJECT_FOLDER
                                    • Call: make
                                    mkdir build
                                    cd build
                                    qmake PATH_TO_YOUR_PROJECT_FOLDER
                                    make
                                    

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

                                    J 1 Reply Last reply
                                    0
                                    • JoeCFDJ JoeCFD

                                      @SGaist True. I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                      Christian EhrlicherC Offline
                                      Christian EhrlicherC Offline
                                      Christian Ehrlicher
                                      Lifetime Qt Champion
                                      wrote on last edited by Christian Ehrlicher
                                      #18

                                      @JoeCFD said in A project build on Raspbian.:

                                      I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                      This is nonsense - there is no difference if you call make or whatever from the command line or from QtCreator.

                                      With 4 threads, make uses about 10% of total memory. But my app needs more than that.

                                      And how do you know the RAM size of the OP? How do you know what headers and libraries are used?

                                      Stop spreading fud!

                                      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
                                      Visit the Qt Academy at https://academy.qt.io/catalog

                                      J 1 Reply Last reply
                                      0
                                      • jsulmJ jsulm

                                        @jenya7

                                        • Open a terminal
                                        • Create a build folder
                                        • Change into build folder
                                        • Call: qmake PATH_TO_PROJECT_FOLDER
                                        • Call: make
                                        mkdir build
                                        cd build
                                        qmake PATH_TO_YOUR_PROJECT_FOLDER
                                        make
                                        
                                        J Offline
                                        J Offline
                                        jenya7
                                        wrote on last edited by
                                        #19

                                        @jsulm
                                        I did
                                        • $ cd my/dir/
                                        • $ qmake -project
                                        • $ qmake
                                        • $ make
                                        It basted my pro file. Removed lines
                                        QT += core gui network xml bluetooth
                                        greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
                                        and I got a lot of errors.

                                        jsulmJ 1 Reply Last reply
                                        0
                                        • Christian EhrlicherC Christian Ehrlicher

                                          @JoeCFD said in A project build on Raspbian.:

                                          I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                          This is nonsense - there is no difference if you call make or whatever from the command line or from QtCreator.

                                          With 4 threads, make uses about 10% of total memory. But my app needs more than that.

                                          And how do you know the RAM size of the OP? How do you know what headers and libraries are used?

                                          Stop spreading fud!

                                          J Offline
                                          J Offline
                                          jenya7
                                          wrote on last edited by jenya7
                                          #20

                                          @Christian-Ehrlicher said in A project build on Raspbian.:

                                          @JoeCFD said in A project build on Raspbian.:

                                          I suspect Qt Creator may have some sort of deadlock issue in update. Often I feel like it is slow with Qt Creator to build. Therefore, I run make from command line almost all the time.

                                          This is nonsense - there is no difference if you call make or whatever from the command line or from QtCreator.

                                          May be the GUI itself loads some extra?

                                          jsulmJ 1 Reply Last reply
                                          0

                                          • Login

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