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. High CPU usage
QtWS25 Last Chance

High CPU usage

Scheduled Pinned Locked Moved Unsolved General and Desktop
27 Posts 8 Posters 5.5k 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.
  • Ketan__Patel__0011K Offline
    Ketan__Patel__0011K Offline
    Ketan__Patel__0011
    wrote on last edited by
    #1

    Hello Friends And QT Experts

    i was create one qt application And i Used Some image Processing Library in my application and used it's functions

    but when i start to bulid my project then QT is take more then 90% cpu usages
    i don't know how this is possible

    i am upload some snapshots of my windows task manager
    you can see in this snapshots:

    Example 1:
    Capture_1.PNG

    Example 2:
    Capture.PNG

    please help me to solve this problem
    Thanks you so much

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      This is while you are compiling ?
      Mine also uses nearly 100% cpu compiling code so not sure
      why you think its an issue ?
      Or did i miss something ?

      Ketan__Patel__0011K 1 Reply Last reply
      3
      • mrjjM mrjj

        Hi
        This is while you are compiling ?
        Mine also uses nearly 100% cpu compiling code so not sure
        why you think its an issue ?
        Or did i miss something ?

        Ketan__Patel__0011K Offline
        Ketan__Patel__0011K Offline
        Ketan__Patel__0011
        wrote on last edited by
        #3

        @mrjj

        yes it is happening when i start compiling

        ofcourse it is very big issue, no any complier or any IDE take more then 90% CPU when code is compiling , even it is also possible to affect CPU and may be possible to system is fail in near future

        JKSHJ raven-worxR 2 Replies Last reply
        0
        • Ketan__Patel__0011K Ketan__Patel__0011

          @mrjj

          yes it is happening when i start compiling

          ofcourse it is very big issue, no any complier or any IDE take more then 90% CPU when code is compiling , even it is also possible to affect CPU and may be possible to system is fail in near future

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @Ketan__Patel__0011 said in High CPU usage:

          no any complier or any IDE take more then 90% CPU when code is compiling

          That means your other compiler/IDE is not making full use of your CPU.

          Higher CPU usage == Shorter compilation time

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          Ketan__Patel__0011K 1 Reply Last reply
          4
          • JKSHJ JKSH

            @Ketan__Patel__0011 said in High CPU usage:

            no any complier or any IDE take more then 90% CPU when code is compiling

            That means your other compiler/IDE is not making full use of your CPU.

            Higher CPU usage == Shorter compilation time

            Ketan__Patel__0011K Offline
            Ketan__Patel__0011K Offline
            Ketan__Patel__0011
            wrote on last edited by
            #5

            @JKSH

            sorry i didn't get it

            can you explain in other way

            JKSHJ 1 Reply Last reply
            0
            • Ketan__Patel__0011K Ketan__Patel__0011

              @JKSH

              sorry i didn't get it

              can you explain in other way

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by
              #6

              @Ketan__Patel__0011 said in High CPU usage:

              @JKSH

              sorry i didn't get it

              can you explain in other way

              I want my compiler to use 100% CPU.

              If my compiler uses 100% CPU, it will finish my project quickly. If my compiler only uses 20% CPU, that means it will take a long time to finish compiling my project.

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              Ketan__Patel__0011K 1 Reply Last reply
              2
              • Ketan__Patel__0011K Ketan__Patel__0011

                @mrjj

                yes it is happening when i start compiling

                ofcourse it is very big issue, no any complier or any IDE take more then 90% CPU when code is compiling , even it is also possible to affect CPU and may be possible to system is fail in near future

                raven-worxR Offline
                raven-worxR Offline
                raven-worx
                Moderators
                wrote on last edited by
                #7

                @Ketan__Patel__0011 said in High CPU usage:

                ofcourse it is very big issue, no any complier or any IDE take more then 90% CPU when code is compiling , even it is also possible to affect CPU and may be possible to system is fail in near future

                where does this conclusion come from?

                --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                If you have a question please use the forum so others can benefit from the solution in the future

                Ketan__Patel__0011K 1 Reply Last reply
                0
                • JKSHJ JKSH

                  @Ketan__Patel__0011 said in High CPU usage:

                  @JKSH

                  sorry i didn't get it

                  can you explain in other way

                  I want my compiler to use 100% CPU.

                  If my compiler uses 100% CPU, it will finish my project quickly. If my compiler only uses 20% CPU, that means it will take a long time to finish compiling my project.

                  Ketan__Patel__0011K Offline
                  Ketan__Patel__0011K Offline
                  Ketan__Patel__0011
                  wrote on last edited by
                  #8

                  @JKSH
                  Thanks for your reply

                  According To your explanation if compiler uses 100% CPU then my project quickly complied

                  but i my case when i start compilation it take 3 to 4 minutes for project compilation
                  and it is huge and high time to build any project

                  so i can't avoid this problem
                  i can give only 1 or 2 minutes for project compilation

                  JKSHJ 1 Reply Last reply
                  0
                  • Ketan__Patel__0011K Ketan__Patel__0011

                    @JKSH
                    Thanks for your reply

                    According To your explanation if compiler uses 100% CPU then my project quickly complied

                    but i my case when i start compilation it take 3 to 4 minutes for project compilation
                    and it is huge and high time to build any project

                    so i can't avoid this problem
                    i can give only 1 or 2 minutes for project compilation

                    JKSHJ Offline
                    JKSHJ Offline
                    JKSH
                    Moderators
                    wrote on last edited by JKSH
                    #9

                    @Ketan__Patel__0011 said in High CPU usage:

                    i can give only 1 or 2 minutes for project compilation

                    Why?

                    What will happen if it takes 4 minutes instead of 2 minutes?

                    when i start compilation it take 3 to 4 minutes for project compilation
                    and it is huge and high time to build any project

                    Compilation time depends on your PC's specifications and your project's complexity.

                    Qt is a huge project. It takes 2 hours to compile Qt on my PC at 100% CPU. This is normal.

                    Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                    Ketan__Patel__0011K 1 Reply Last reply
                    1
                    • JKSHJ JKSH

                      @Ketan__Patel__0011 said in High CPU usage:

                      i can give only 1 or 2 minutes for project compilation

                      Why?

                      What will happen if it takes 4 minutes instead of 2 minutes?

                      when i start compilation it take 3 to 4 minutes for project compilation
                      and it is huge and high time to build any project

                      Compilation time depends on your PC's specifications and your project's complexity.

                      Qt is a huge project. It takes 2 hours to compile Qt on my PC at 100% CPU. This is normal.

                      Ketan__Patel__0011K Offline
                      Ketan__Patel__0011K Offline
                      Ketan__Patel__0011
                      wrote on last edited by
                      #10

                      @JKSH

                      Thanks for Reply
                      Okay Let me tell you my PC's specifications

                      -> intel(R) Core(TM) I3-3220 CPU @ 3.30GHz
                      -> Shared GPU Memory
                      -> 64 Bit OS Windows 10 Pro
                      -> 1TB SSD
                      -> 8GM RAM

                      this are specifications in my PC have it
                      and My Project Complexity is i just used my Image Processing function that's it nothing more

                      Or Other things is if My Application is running that time it take high CPU uses than i can control but at compilation time CPU Uses Control is not in my hand.

                      and in your case ,2 hours to compile your Project on your PC so i can assume your Project is not any simple Desktop application or not any simple GUI base Application it may Be Very Valuable Project.

                      1 Reply Last reply
                      0
                      • raven-worxR raven-worx

                        @Ketan__Patel__0011 said in High CPU usage:

                        ofcourse it is very big issue, no any complier or any IDE take more then 90% CPU when code is compiling , even it is also possible to affect CPU and may be possible to system is fail in near future

                        where does this conclusion come from?

                        Ketan__Patel__0011K Offline
                        Ketan__Patel__0011K Offline
                        Ketan__Patel__0011
                        wrote on last edited by
                        #11

                        @raven-worx

                        run your applications in your system which are uses more than 70% CPU and also your application run 10 to 20 function working parallelly For continuously 2 or 3 days. that time it may be your system can be failed.

                        in any program or application have memory leakage that time programmers can handle it at run time using memory concepts but CPU uses control at runtime it is very difficult and very complex

                        raven-worxR 1 Reply Last reply
                        0
                        • Ketan__Patel__0011K Ketan__Patel__0011

                          @raven-worx

                          run your applications in your system which are uses more than 70% CPU and also your application run 10 to 20 function working parallelly For continuously 2 or 3 days. that time it may be your system can be failed.

                          in any program or application have memory leakage that time programmers can handle it at run time using memory concepts but CPU uses control at runtime it is very difficult and very complex

                          raven-worxR Offline
                          raven-worxR Offline
                          raven-worx
                          Moderators
                          wrote on last edited by
                          #12

                          @Ketan__Patel__0011 said in High CPU usage:

                          run your applications in your system which are uses more than 70% CPU and also your application run 10 to 20 function working parallelly For continuously 2 or 3 days. that time it may be your system can be failed.

                          now you are talking about faulty applications. Before you were talking about running the compiler.
                          A faulty application may make your system unstable yes. But thats the fault of a badly programmed application then. Even if the system is out of memory the OS tries to solve it and terminates the application. The application should be fixed then.
                          So the conclusion that 100% CPU means unstable system is still wrong. If the application is programmed correctly the machine can run for weeks with 100% CPU load.

                          --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
                          If you have a question please use the forum so others can benefit from the solution in the future

                          Ketan__Patel__0011K 1 Reply Last reply
                          3
                          • A Offline
                            A Offline
                            Anonymous_Banned275
                            wrote on last edited by
                            #13

                            Perhaps OP is using / is concerned about wrong measuring stick.

                            Maybe he should try this approach .
                            Compile an application with barely any other software running -
                            I did and it took 50 seconds to finish.
                            Then I run musical video and after recompile I got 1:20 seconds.
                            Both apps are sharing SOME resources and both are performing as expected.

                            In other way - 100% CPU usage is not about overloading the CPU.

                            100% usage should be viewed as top notch efficiency of the compiler instead.

                            1 Reply Last reply
                            3
                            • raven-worxR raven-worx

                              @Ketan__Patel__0011 said in High CPU usage:

                              run your applications in your system which are uses more than 70% CPU and also your application run 10 to 20 function working parallelly For continuously 2 or 3 days. that time it may be your system can be failed.

                              now you are talking about faulty applications. Before you were talking about running the compiler.
                              A faulty application may make your system unstable yes. But thats the fault of a badly programmed application then. Even if the system is out of memory the OS tries to solve it and terminates the application. The application should be fixed then.
                              So the conclusion that 100% CPU means unstable system is still wrong. If the application is programmed correctly the machine can run for weeks with 100% CPU load.

                              Ketan__Patel__0011K Offline
                              Ketan__Patel__0011K Offline
                              Ketan__Patel__0011
                              wrote on last edited by
                              #14

                              @raven-worx

                              again if 100% CPU uses at runtime when i perform any operation that time i can deal with it but at compile time it may be problem comes from the compiler or may be my Qt Version is unstable

                              ->My Qt Version Is : 5.12.3

                              JonBJ O 2 Replies Last reply
                              0
                              • Ketan__Patel__0011K Ketan__Patel__0011

                                @raven-worx

                                again if 100% CPU uses at runtime when i perform any operation that time i can deal with it but at compile time it may be problem comes from the compiler or may be my Qt Version is unstable

                                ->My Qt Version Is : 5.12.3

                                JonBJ Offline
                                JonBJ Offline
                                JonB
                                wrote on last edited by
                                #15

                                @Ketan__Patel__0011
                                Your Qt version is probably not relevant. You are reporting the C++ compiler taking a lot of time. And since you say

                                i was create one qt application And i Used Some image Processing Library in my application and used it's functions

                                I can only guess that your image processing library --- the header files you include from it --- are so "complex" that it just takes the compiler a long time to compile code which includes them.

                                Please confirm that if you let it take whatever time it wants your compile/link do complete successfully? In which case I wouldn't worry about it, it is what it is. If on the other hand it fails to come to a successful conclusion, then that would be a different matter....

                                Ketan__Patel__0011K 1 Reply Last reply
                                0
                                • Ketan__Patel__0011K Ketan__Patel__0011

                                  @raven-worx

                                  again if 100% CPU uses at runtime when i perform any operation that time i can deal with it but at compile time it may be problem comes from the compiler or may be my Qt Version is unstable

                                  ->My Qt Version Is : 5.12.3

                                  O Offline
                                  O Offline
                                  ollarch
                                  wrote on last edited by
                                  #16

                                  @Ketan__Patel__0011
                                  When you run the application the complier does nothing. It have finished the work and it have generated an executable file.
                                  Are you sure that the application is not doing anything?
                                  Could you try to comment the processing library include files and run the application again?

                                  Ketan__Patel__0011K 1 Reply Last reply
                                  0
                                  • JonBJ JonB

                                    @Ketan__Patel__0011
                                    Your Qt version is probably not relevant. You are reporting the C++ compiler taking a lot of time. And since you say

                                    i was create one qt application And i Used Some image Processing Library in my application and used it's functions

                                    I can only guess that your image processing library --- the header files you include from it --- are so "complex" that it just takes the compiler a long time to compile code which includes them.

                                    Please confirm that if you let it take whatever time it wants your compile/link do complete successfully? In which case I wouldn't worry about it, it is what it is. If on the other hand it fails to come to a successful conclusion, then that would be a different matter....

                                    Ketan__Patel__0011K Offline
                                    Ketan__Patel__0011K Offline
                                    Ketan__Patel__0011
                                    wrote on last edited by
                                    #17

                                    @JonB

                                    Thanks for you reply

                                    i am used Same Library in Microsoft visual studio 2015 and i create new project in Microsoft visual studio 2015 and i didn't get Any Issus my project Compile Successfully
                                    and when i start compiling my visual studio c++ project that time my System used less than 20% Of CPU.

                                    and i think in Qt MSVC 2015 Kit and Microsoft Visual Studio 2015 are used Same Compiler for C++

                                    O 1 Reply Last reply
                                    0
                                    • O ollarch

                                      @Ketan__Patel__0011
                                      When you run the application the complier does nothing. It have finished the work and it have generated an executable file.
                                      Are you sure that the application is not doing anything?
                                      Could you try to comment the processing library include files and run the application again?

                                      Ketan__Patel__0011K Offline
                                      Ketan__Patel__0011K Offline
                                      Ketan__Patel__0011
                                      wrote on last edited by
                                      #18

                                      @ollarch

                                      Thanks for your Reply

                                      I am faced this problem Many Time ,but i didn't get any solution
                                      if i used any library or not

                                      1 Reply Last reply
                                      0
                                      • Ketan__Patel__0011K Ketan__Patel__0011

                                        @JonB

                                        Thanks for you reply

                                        i am used Same Library in Microsoft visual studio 2015 and i create new project in Microsoft visual studio 2015 and i didn't get Any Issus my project Compile Successfully
                                        and when i start compiling my visual studio c++ project that time my System used less than 20% Of CPU.

                                        and i think in Qt MSVC 2015 Kit and Microsoft Visual Studio 2015 are used Same Compiler for C++

                                        O Offline
                                        O Offline
                                        ollarch
                                        wrote on last edited by
                                        #19

                                        @Ketan__Patel__0011
                                        You are mixing compilation times and execution times. Where is your problem? When compiling or when running? And wich is the problem? High CPU usage? When comiling as more CPU used less time to compile and when running it will depend on what is your application doing.
                                        About faulty applications... If it faults it has a bug so you have to find it and remove it.

                                        JonBJ Ketan__Patel__0011K 2 Replies Last reply
                                        0
                                        • O ollarch

                                          @Ketan__Patel__0011
                                          You are mixing compilation times and execution times. Where is your problem? When compiling or when running? And wich is the problem? High CPU usage? When comiling as more CPU used less time to compile and when running it will depend on what is your application doing.
                                          About faulty applications... If it faults it has a bug so you have to find it and remove it.

                                          JonBJ Offline
                                          JonBJ Offline
                                          JonB
                                          wrote on last edited by JonB
                                          #20

                                          @ollarch
                                          I believe @Ketan__Patel__0011 has consistently only reported compilation/link timings, I don't see where you see he might be reporting runtime execution time?

                                          If he says that outside of Qt Creator it compiles with 20% CPU while inside it is 90% that does sound a touch strange.... It looks like it is the Microsoft Compiler Driver which is taking the time....

                                          O 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