Home > Software engineering >  Qt application Windows environment for a long time running, interface card, need to restart the oper
Qt application Windows environment for a long time running, interface card, need to restart the oper

Time:09-25

Qt4.8 developed software, run only on Windows, the user environment appear a few times no responses caton phenomenon, restart software caton still no response, after the restart the operating system software is normal,

Said the software, the software is need long time running, design some data collection, curve list interface, and so on, my development environment is stable, the user's environment is also stable and steady at around 10% CPU, memory, more than one hundred M, but it appeared several times,

I the development of the local environment and win10, Qt4.8 for vs2008, Qt Creator

The first kind of phenomenon, several computer users by doing win10, Windows 7, run all at ordinary times, once appear interface card click does not respond, restart the software also doesn't work, because the user's computer again not to close (months), I require the user to restart the computer, restart the software is normal, my explanation is that Windows itself is not stable, long run graphical interface software need to restart,

Second phenomenon, users to deploy a new computer recently, Windows 7, start the software will only have a few controls with the click of a mouse response, concrete phenomenon: click on the button, for example, only a few click on the button response, such as QTabWidget, click the TAB also didn't response, software used in a number of QTabWidget, software restart also not line, every time after the restart software response button is different; I made some attempts, the software starts, using the TAB key, it can switch different the focus of the button, you can switch QTabWidget TAB focus; Another try, I compiled a simple Qt application, only a QTabWidget control, several button several editLabel, also have the same phenomenon, the mouse to click can't all the response, the TAB key to switch the focus of the control,

To ask how to explain these two phenomenon, thank you very much

CodePudding user response:

A few instructions
1. Here are two phenomenon occurs, other software is normal operation, such as a browser, such as word, just my software does not respond to restart also not line, you have to restart the operating system;
2. No testing, problems arise, the operation of other Qt software written if you have any questions (not released I write software);

CodePudding user response:

Restart software caton still does not respond, after restart the operating system software is normal,
Software is a little bad,,,
Personal feeling is the kernel object depleted,

Caton does not respond, to see the CPU % is too high, that is considered a bug of infinite loop, can read the software log, jammed the last part which

Restart the also not line, that is not the possibility of an infinite loop,

CodePudding user response:

Thank you for your reply, Windows kernel object concept I have nothing, also please to guidance;
A card may not be accurate, according to the phenomenon of "click on the button, only a few click on the button response... Use the TAB key, you can switch different button focus ", in fact is not like, such as the main thread time-consuming, more like software inaccurate responses of a mouse,
Another card immediately CPU is very low, the appearance of the software basic 0% CPU, the system CPU, memory is very low,
I think Qt some principle and the principle of the Windows have what conflict, leading to Qt software long run, will be exhausted of some of the Windows, and then you have to restart the operating system,

refer to the second floor smwhotjay response:
restart software caton still no response, after the restart the operating system software is normal,
Software is a little bad,,,
Personal feeling is the kernel object depleted,

Caton does not respond, to see the CPU % is too high, that is considered a bug of infinite loop, can read the software log, jammed the last part which

Restart the also not line, that is not the possibility of an infinite loop,

CodePudding user response:

One way to check whether resource leaks:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"

CodePudding user response:

Memory leaks or GDI resource leaks? Open the task manager window see ~

CodePudding user response:

Can restart, there is a big possibility into an infinite loop, or memory leaks due to the need for disk exchange operation, seriously affect the program is running

CodePudding user response:

The possibility of a memory leak or GDI resource leaks great


CodePudding user response:

reference 4 floor zhao4zhong1 response:
check whether resource leaks one way:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"

Consult the GDI leaks, whether process exits also not line, must restart the operating system

CodePudding user response:

reference 4 floor zhao4zhong1 response:
check whether resource leaks one way:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"

Did some test, if we can have a handle to leak, result in
you have to restart the operating system

CodePudding user response:

reference 4 floor zhao4zhong1 response:
check whether resource leaks one way:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"

Thanks for a great god, and to check the program application of kernel resources, it is not right to release, after the program exits the operating system will not take back, lead to the kernel leak resources, accumulated much finally sure to restart the computer,
My direction positioning leaked into the kernel resources, according to find the direction

CodePudding user response:

https://docs.microsoft.com/zh-cn/sysinternals/downloads/handle

CodePudding user response:

https://docs.microsoft.com/zh-cn/sysinternals/downloads/process-explorer
  • Related