P3: Somewhat important
QtCreator Win10 Desktop Qt5.12.3 MSVC2015 64bit
1M There is a test project, development tool QtCreator, compiler Desktop Qt5.12.3 MSVC2015 64bit,
1. I will convert the picture (.jpg) to be used as image.rcc file for future use.
2. I encapsulate the registerResource () and unregisterResource () functions in a C++ class.
3. Use the picture in main.qml in the same way as qrc: Image
Program running steps and memory changes:
1. Program running, memory consumption 12.9M
2.registerResource (image.rcc) (return value true), memory consumption 13.6M
3. Display the picture (source: "qrc: /xxx.jpg"), the memory footprint is 199.7M
4. No picture is displayed (source: ""), the memory footprint is 138.1M
5.unregisterResource (image.rcc) (return value is true), memory usage is 137.3M (at this time, if I keep waiting, in most cases, the memory usage will remain at 137.3M)
6. Wait for 1 ~ 2s (must wait otherwise, it is invalid), unregisterResource (image.rcc) (return value is false), memory usage is 75.6M
7. Wait for 1 ~ 2s (must wait otherwise, it is invalid), unregisterResource (image.rcc) (return value is false), memory usage is 13.1M