Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
How-to works QPixmapCache ?!
hizoka last edited by hizoka
I use a QPixmapCache (I load several hundred QPixmap) for a big gain time, that works good when I launch my software.
But after several minutes, the QPixmapCache losts many QPixmap...
This is the same result if I wait without do anything or if I use it...
I don't understand why ?!
I have increase the cachelimit to 1go but, it the same thing...
Is it normal ?! Maybe haven't I understand something ?
Thanks et have a nice day !
EDIT : I have found this :
8 years ago... ?!
And pyqt haven't QCache class...
I reload the cache every second, I up the memory used from ~180 to ~225mo.
If I add a clear() before reload the cache, I up to 350mo ?!!
The cache isn't really clear ?!
I don't understand...
What version of Qt are you using ?
On what OS ?
hizoka last edited by
Oups sorry :)
Qt : 5.9.1
python : 3.6.3
I'm not familiar with how to use QPixmapCache, but from your descriptions it looks like there might be problems with its internal implementation.
Your question is about the internal details of Qt, so the best place is at the Interest mailing list. Subscribe there and post your questions -- Qt's engineers are active on that list.
All the best!
Asperamanca last edited by
How big are all your pixmaps combined, compared to your cache size?
There's an interesting description to the function that's called by the 30 sec timer:
This is supposed to cut the cache size down by about 25% in a
minute once the application becomes idle, to let any inserted pixmap
remain in the cache for some time before it becomes a candidate for
cleaning-up, and to not cut down the size of the cache while the
cache is in active use.
When the last detached pixmap has been deleted from the cache, kill the
timer so Qt won't keep the CPU from going into sleep mode. Currently
the timer is not restarted when the pixmap becomes unused, but it does
restart once something else is added (i.e. the cache space is actually needed).
So if the total size of your pixmaps is > 75 % of the cache size, the behavior is explainable. Otherwise, it smells like a bug.
hizoka last edited by
Hi, thank's for your replies !
I have 650 thumbnail files for a weight to 8mo...
I have updated the cache's limit to 1go... I have tryed with 100mo, 500mo...
I will try to post a mail to the Qt's engineers.