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. Building Qt from source with QtWebEngine causing OOM crashes

Building Qt from source with QtWebEngine causing OOM crashes

Scheduled Pinned Locked Moved Solved General and Desktop
8 Posts 3 Posters 1.3k 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
    quutee
    wrote on last edited by
    #1

    Hi,

    I am compiling Qt 5.15.8 from source on Ubuntu 20.04 (8-core/16 GB RAM) with QtWebEngine module enabled. After sometime everything running on the machine closes automatically. It seems ninja (internally used for building chromium) is building on all cores even if I trigger the build using make -j1, and consumes all the memory.
    Screenshot from 2023-02-26 16-37-13.png
    Notice how the CPU usage drops as memory peaks to 100%.

    I did not encounter this problem on macOS. Has anyone else faced this issue? Any tips on how to prevent these OOM crashes?

    jsulmJ O 2 Replies Last reply
    0
    • Q quutee

      I added 64GB swap space, but ld still crashes (along with the terminal from which make is run). It doesn't seem to be using swap space much even though I have set swappiness to 100.

      Q Offline
      Q Offline
      quutee
      wrote on last edited by quutee
      #8

      I disabled symbol generation for chromium by adding the following line to qtwebengine/src/core/gn_run.pro to reduce the memory required during linking.

      gn_args += symbol_level=0
      

      There's also a flag that can be passed to configure to disable chromium symbols but it didn't work.

      1 Reply Last reply
      0
      • Q quutee

        Hi,

        I am compiling Qt 5.15.8 from source on Ubuntu 20.04 (8-core/16 GB RAM) with QtWebEngine module enabled. After sometime everything running on the machine closes automatically. It seems ninja (internally used for building chromium) is building on all cores even if I trigger the build using make -j1, and consumes all the memory.
        Screenshot from 2023-02-26 16-37-13.png
        Notice how the CPU usage drops as memory peaks to 100%.

        I did not encounter this problem on macOS. Has anyone else faced this issue? Any tips on how to prevent these OOM crashes?

        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #2

        @quutee Does "ninja -j 1" help?

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        0
        • Q quutee

          Hi,

          I am compiling Qt 5.15.8 from source on Ubuntu 20.04 (8-core/16 GB RAM) with QtWebEngine module enabled. After sometime everything running on the machine closes automatically. It seems ninja (internally used for building chromium) is building on all cores even if I trigger the build using make -j1, and consumes all the memory.
          Screenshot from 2023-02-26 16-37-13.png
          Notice how the CPU usage drops as memory peaks to 100%.

          I did not encounter this problem on macOS. Has anyone else faced this issue? Any tips on how to prevent these OOM crashes?

          O Offline
          O Offline
          odelaune
          wrote on last edited by odelaune
          #3

          @quutee
          Building QWebEngine is really a nightmare. Please read this post.
          The only way I know is to fake the number of CPU available on the system using chcpu. If you do not have sudo right for chcpu then I cannot help you (I am also looking for a solution ...).

          Q 1 Reply Last reply
          1
          • O odelaune

            @quutee
            Building QWebEngine is really a nightmare. Please read this post.
            The only way I know is to fake the number of CPU available on the system using chcpu. If you do not have sudo right for chcpu then I cannot help you (I am also looking for a solution ...).

            Q Offline
            Q Offline
            quutee
            wrote on last edited by
            #4

            @odelaune I do have sudo permissions and was able to build release shared builds by disabling half the cpu cores but shared debug build still fails on the linking step.

            O 1 Reply Last reply
            0
            • Q quutee

              @odelaune I do have sudo permissions and was able to build release shared builds by disabling half the cpu cores but shared debug build still fails on the linking step.

              O Offline
              O Offline
              odelaune
              wrote on last edited by
              #5

              @quutee said in Building Qt from source with QtWebEngine causing OOM crashes:

              shared debug build still fails on the linking step.

              What is the error you get?

              Q 1 Reply Last reply
              0
              • O odelaune

                @quutee said in Building Qt from source with QtWebEngine causing OOM crashes:

                shared debug build still fails on the linking step.

                What is the error you get?

                Q Offline
                Q Offline
                quutee
                wrote on last edited by quutee
                #6

                @odelaune ld receives a kill signal (due to OOM) when linking qtwebcoreengine.so.

                Q 1 Reply Last reply
                0
                • Q quutee

                  @odelaune ld receives a kill signal (due to OOM) when linking qtwebcoreengine.so.

                  Q Offline
                  Q Offline
                  quutee
                  wrote on last edited by quutee
                  #7

                  I added 64GB swap space, but ld still crashes (along with the terminal from which make is run). It doesn't seem to be using swap space much even though I have set swappiness to 100.

                  Q 1 Reply Last reply
                  0
                  • Q quutee

                    I added 64GB swap space, but ld still crashes (along with the terminal from which make is run). It doesn't seem to be using swap space much even though I have set swappiness to 100.

                    Q Offline
                    Q Offline
                    quutee
                    wrote on last edited by quutee
                    #8

                    I disabled symbol generation for chromium by adding the following line to qtwebengine/src/core/gn_run.pro to reduce the memory required during linking.

                    gn_args += symbol_level=0
                    

                    There's also a flag that can be passed to configure to disable chromium symbols but it didn't work.

                    1 Reply Last reply
                    0
                    • Q quutee has marked this topic as solved on

                    • Login

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