has been focused on functional development, without attention to CPU and memory. I stumbled across two questions yesterday:
1. After the program starts, nothing is done and the CPU is 50% (single core). Now want to find the reason to reduce the use rate, feel not at all, if usually pay attention to this problem.
2. As the function of the program runs, the memory is growing. Memory leaks also have, but very few, are a few K-K growth, this does not matter. But more crucially, when running the data in the thread, a few super-large maps were created, and it was written that Deletelater automatically frees the memory after the thread runs, but also releases the super-large map, but you don't know when the QT library will delete it. Causes the program memory to change from 20M to hundreds of m at a sudden, and does not degrade. I learned to be smart, after the map data does not need to be clear, this does not affect the subsequent logic. There are no other factors that need to be controlled at this time. It's not easy to develop a complete software.
In addition, the memory consumption is large, the program response is very slow, but my machine memory is obviously 16G, this is why?
When developing, be sure to control CPU usage and use memory size in time