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. why cpu utilization increase as we load more images in thumbnail image previewer ?

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

Scheduled Pinned Locked Moved Solved General and Desktop
11 Posts 4 Posters 465 Views
  • 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 Offline
    Q Offline
    Qt embedded developer
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #9

      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
      3
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #2

        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
        0
        • Kent-DorfmanK Offline
          Kent-DorfmanK Offline
          Kent-Dorfman
          wrote on last edited by
          #3

          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
          0
          • Kent-DorfmanK Kent-Dorfman

            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 Offline
            Q Offline
            Qt embedded developer
            wrote on last edited by Qt embedded developer
            #4

            @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
            0
            • Kent-DorfmanK Offline
              Kent-DorfmanK Offline
              Kent-Dorfman
              wrote on last edited by
              #5

              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
              0
              • nageshN Offline
                nageshN Offline
                nagesh
                wrote on last edited by
                #6

                @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
                0
                • Kent-DorfmanK Kent-Dorfman

                  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 Offline
                  Q Offline
                  Qt embedded developer
                  wrote on last edited by
                  #7

                  @Kent-Dorfman i have edited my reply

                  1 Reply Last reply
                  0
                  • nageshN nagesh

                    @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 Offline
                    Q Offline
                    Qt embedded developer
                    wrote on last edited by Qt embedded developer
                    #8

                    @nagesh

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

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

                      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
                      3
                      • SGaistS SGaist

                        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.

                        Q Offline
                        Q Offline
                        Qt embedded developer
                        wrote on last edited by Qt embedded developer
                        #10

                        @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
                        0
                        • SGaistS Offline
                          SGaistS Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on last edited by
                          #11

                          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
                          2

                          • Login

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