Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How-to works QPixmapCache ?!
Forum Updated to NodeBB v4.3 + New Features

How-to works QPixmapCache ?!

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 4 Posters 1.4k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hizoka
    wrote on last edited by hizoka
    #1

    Hi,

    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 :
    https://git-service.ait.ac.at/svs-lgpl/qt-4-for-sma-annotator/commit/c999065d5090a64192f96bed78c5224490409d6a
    https://bugreports.qt.io/browse/QTBUG-31452
    8 years ago... ?!

    And pyqt haven't QCache class...

    EDIT2:
    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...

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What version of Qt are you using ?
      On what OS ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hizoka
        wrote on last edited by
        #3

        Oups sorry :)

        Kubuntu 17.10
        Qt : 5.9.1
        python : 3.6.3

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          Hi @hizoka,

          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!

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          1
          • A Offline
            A Offline
            Asperamanca
            wrote on last edited by
            #5

            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.

            1 Reply Last reply
            1
            • H Offline
              H Offline
              hizoka
              wrote on last edited by
              #6

              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.

              1 Reply Last reply
              0

              • Login

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved