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.
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
-
@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. -
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.
-
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
-
@Ketan__Patel__0011
Your Qt version is probably not relevant. You are reporting the C++ compiler taking a lot of time. And since you sayi 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__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? -
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++
-
@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. -
@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....
-
@JonB
Maybe QtCreator is uning multiprocessor compiling while Visual Studio is not. The Intel i3-3220 has 4 core threads, so 20~25 CPU usage during compilation sounds like only one core is used.
On Visual Studio check the "C/C++" options , section "All options" parameter "Additional options", and set "/MP4" to it. It will use 4 cores on compilation. -
Thanks for your reply and your suggestion
i will try your idea But I am not developing Software in visual studio.
i am developing software in QT, currently am working on this problem.
doesn't matter why Microsoft visual studio 2015 not use more than 20-25% of CPUMy higher priority is to solve this problem in QT
or If you get any other idea or any other solution for it than please drop your answer or suggestion here
Again Thanks You So Much -
@Ketan__Patel__0011
For MSVC builds, Qt uses jom instead of nmake, to build in parallel, use more CPU and speed up the building.
You can refer to:
https://wiki.qt.io/Jom
https://www.qt.io/blog/2009/03/27/speeding-up-visual-c-qt-builds -
(Side discussion forked to https://forum.qt.io/topic/119207/relationships-between-qmake-make-nmake-jom-and-the-compiler )