Details
-
Bug
-
Resolution: Out of scope
-
Not Evaluated
-
None
-
5.12.0
-
None
-
Arch Linux - i7-4770 w/ 8GB DDR3, using GCC
Description
I have a bunch of threads being created very quickly with QtConcurrent, and I'm reading an image with QImageReader in each one and returning it with QFutureWatcher. Memory usage will inflate to well over 500MiB, when it should be less than 300MiB. The memory usage stays that high for around five to ten minutes, and will clear chunks of about 120MiB until it reaches normal levels.
This is for an image viewer program, and the behavior is the result of preloading images while holding the arrow key to switch images as fast as possible.
The behavior does not occur when the QThreadPool is limited to one thread, and occurs slightly less when limited to thread counts lower than normal. The behavior does not appear to occur on WIndows or macOS, just Linux.
The relevant source code can be found here - If you compile it, make sure to set preloading to extended in the settings. I also attached a very simple program that can reproduce the issue, albeit somewhat less severely than my actual program.
If anyone can tell me if I'm doing something wrong, I'd greatly appreciate it. I can't find a solution to this besides limiting thread usage, which dramatically slows down preloading.