New Opera Forums launching soon!
Discussion thread

Opera burns CPU with poll()+recvmsg() loop

pfactum
pfactum

12 posts

    Opera 45.0.2552.812, latest Arch Linux.

    Right from start Opera burns CPU with poll() loop as shown by strace: [1]

    It is always 2 file descriptors, in this case, 110 and 117.

    Looking at it closer, strace shows backtraces for each EAGAIN'ed recvmsg: [2]

    Looks like it has something to do with X server interaction.

    Checking those descriptors here: [3]

    Closing those descriptors via gdb results in Opera SIGSEGV.

    Always reproducible, even with clean profile and no extensions.

    Is there any option how to save my CPU cycles?

    Thanks.

    [1] https://gist.github.com/a8d11ac5477982128525f51f11d3ca4d [2] https://gist.github.com/d32b99483a5c236cbd92aa38e586741f [3] https://gist.github.com/5aee3ef7d487a67e23d7d001f2c46ea6

    11 Replies - 305 Views

    pfactum
    0 0
    pfactum

    12 posts

      Reproduced on 2 machines with Arch and on 1 machine with Gentoo. CPU usage varies depending on CPU power, but strace shows similar picture (EAGAIN flood).

      pfactum
      0 0
      pfactum

      12 posts

        Same applies to Chromium 58.0.3029.110. The only difference is that EAGAIN arrives more rarely (once per several, up to 10, seconds), thus CPU is not used that high as by Opera.

        So, it has something to do with engine.

        pfactum
        0 0
        pfactum

        12 posts

          Same applies to 45.0.2552.881.

          pfactum
          0 0
          pfactum

          12 posts

            Same with 45.0.2552.888.

            jimunderscorep
            0 0
            jimunderscorep

            127 posts

              Having nothing to add to your problem, I would like to mention that chromium was updated to 59.x today from upstream. Check if that solves your problem.

              pfactum
              0 0
              pfactum

              12 posts

                Again, same applies to Chromium 59.0.3071.86, but to less extent. strace shows the same picture, but recvmsg fails with EAGAIN once per several seconds, thus CPU load is minimal. For Opera, recvmsg returns EAGAIN lots of times per second, and CPU load is noticeable.

                So, this has something to do with common engine code, likely, interaction with X server.

                pfactum
                0 0
                pfactum

                12 posts

                  Same with v45.0.2552.898.

                  avl
                  1 0
                  avl

                  426 posts

                  • Opera employee
                  • Moderator

                  Hi @pfactum, what you're seeing in strace is the message loop. Every UI application has one, and among other things, it handles communication with the X11 server. It is indeed very busy - a browser sends and receives lots of messages, many in one second. Getting EAGAIN is a normal part of life, and might indicate that Opera is busy (meaning that messages that are no longer relevant don't need to be handled). The EAGAIN is more likely to be a symptom than an effect of the high CPU usage you see.

                  If you still see high CPU usage while using Opera, check out the built-in Task Manager to see exactly which process is using CPU, perhaps then we can find out what's happening on your system.

                  pfactum
                  0 0
                  pfactum

                  12 posts

                    @avl, in Task Manager, "Browser" process consumes 15 to 25% of CPU.

                    Still applies to v46.0.2597.26.

                    pfactum
                    0 0
                    pfactum

                    12 posts

                      Still applies to v46.0.2597.32.

                      pfactum
                      0 0
                      pfactum

                      12 posts

                        Same with v46.0.2597.39.