Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Solved why cpu utilization increase as we load more images in thumbnail image previewer ?

    General and Desktop
    4
    11
    160
    Loading More Posts
    • 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.
    • Q
      Qt embedded developer last edited by

      In my application as we show more than 7 GB image's thumbnail cpu utilization become
      100 percentage. i used thread inside that thread i load this image previewer at 100 ms using timer. i want reason and its solution.

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        As already suggested in one of your other threads, do not try to load each and every thumbnails at the same time. Use a cache to contain the number of visible images and update the cache content when the user scroll but it does not make sense to try to load a gazillion images in any case.

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

        Q 1 Reply Last reply Reply Quote 3
        • SGaist
          SGaist Lifetime Qt Champion last edited by

          Hi,

          @Qt-embedded-developer said in why cpu utilization increase as we load more images in thumbnail image previewer ?:

          i want reason and its solution.

          Do a performance analysis of your code and fix the hot spots.

          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 Reply Quote 0
          • Kent-Dorfman
            Kent-Dorfman last edited by

            As a WAG, are you stressing the virtual memory manager. How much memory in the system? What is the swap doing? is it an 8GB RAM system?

            Second WAG would be, is each image being treated as a separate distinct qobject derived component? That could drive the event loop nuts.

            Q 1 Reply Last reply Reply Quote 0
            • Q
              Qt embedded developer @Kent-Dorfman last edited by Qt embedded developer

              @Kent-Dorfman i found that i have total 1002 MB ram, used ram 287 MB , free ram which is increasing continuously while loading continuous image is 485 MB , buffer/cache 228 MB , availbale ram is 694 MB .

              the actual problem is i used thread which is using 100 % CPU core when loading image Continuously in loop

              1 Reply Last reply Reply Quote 0
              • Kent-Dorfman
                Kent-Dorfman last edited by

                re - load loop: that would do it. LOL

                Wow...only 10megabytes of ram? Please use big B little b correctly when you abbreviate. or better yet, fight that urge to abbreviate. I'm stuck with using low quality SD cards (that WILL FAIL) on a project because someone in the planning phase misread bits vs bytes and assumed they were being given 32Gbytes of radation hardenned flash storage.

                Q 1 Reply Last reply Reply Quote 0
                • nagesh
                  nagesh last edited by

                  @Qt-embedded-developer said in why cpu utilization increase as we load more images in thumbnail image previewer ?:

                  In my application as we show more than 7 GB image's thumbnail

                  At a single point of time how many images loaded as thumbnail?
                  How many images you are viewing on the screen?

                  Q 1 Reply Last reply Reply Quote 0
                  • Q
                    Qt embedded developer @Kent-Dorfman last edited by

                    @Kent-Dorfman i have edited my reply

                    1 Reply Last reply Reply Quote 0
                    • Q
                      Qt embedded developer @nagesh last edited by Qt embedded developer

                      @nagesh

                      ans 1] max range is 25 GB
                      ans 2] 20 image

                      1 Reply Last reply Reply Quote 0
                      • SGaist
                        SGaist Lifetime Qt Champion last edited by

                        As already suggested in one of your other threads, do not try to load each and every thumbnails at the same time. Use a cache to contain the number of visible images and update the cache content when the user scroll but it does not make sense to try to load a gazillion images in any case.

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

                        Q 1 Reply Last reply Reply Quote 3
                        • Q
                          Qt embedded developer @SGaist last edited by Qt embedded developer

                          @SGaist How to use cache in my case using qt ? is there any example is there ?

                          i want to dig more so i can improve my code.

                          1 Reply Last reply Reply Quote 0
                          • SGaist
                            SGaist Lifetime Qt Champion last edited by

                            QPixmapCache can be a good start.

                            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 Reply Quote 2
                            • First post
                              Last post