Can't build QtWebEngine. Compiler out of heap space error!
-
Operating System: Windows 10 (64 bit) 22H2 Home Edition
Error: C1002: compiler is out of heap space in pass 2
Configure Command: "C:\Qt\Src\configure.bat" -prefix "C:\Qt\Binary" -release -skip qt3d -skip qt5compat -skip qtactiveqt -skip qtcharts -skip qtcoap -skip qtconnectivity -skip qtdatavis3d -skip qtdoc -skip qtgraphs -skip qtgrpc -skip qthttpserver -skip qtimageformats -skip qtinsighttracker -skip qtlanguageserver -skip qtlocation -skip qtlottie -skip qtmqtt -skip qtmultimedia -skip qtnetworkauth -skip qtopcua -skip qtpositioning -skip qtquick3d -skip qtquick3dphysics -skip qtquickeffectmaker -skip qtquicktimeline -skip qtremoteobjects -skip qtscxml -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtsvg -skip qttools -skip qttranslations -skip qtvirtualkeyboard -skip qtwayland -skip qtwebchannel -skip qtwebsockets -skip qtwebview -webengine-proprietary-codecs -no-webengine-jumbo-build
Build Command: cmake --build "C:\Qt\Build"
Every time I try to build qtwebengine it fails with this error: "C:\Qt\Src\qtwebengine\src\3rdparty\chromium\third_party\highway\src\hwy\ops\emu128-inl.h" (69) : fatal error C1002: compiler is out of heap space in pass 2.
I looked in the task manager and cl.exe is using a lot of memory almost 100Gb of ram is used. Why is this happening? Why does building qtwebengine needs over 100GB of ram just to build? Help Please! I am building qtwebengine from source because I need to enable proprietary codecs to play certain video formats. I am using a 64 bit version of windows and the x64 native tools from visual studio 2022 so the compiler is also 64 bit.
-
@new-user Make sure to use the 64bit compiler (64bit x64 command prompt). It will not compile with a 32bit compiler as 2GB of usable Ram is not enough as you noticed.
-
@Christian-Ehrlicher The OS and the msvc compiler used for building qtwebengine are both x64 bit
-
@new-user I doubt so. Please post the output of 'where CL. exe'
-
-
@new-user OK, then you really need more Ram or don't build webengine. Why do you want to build Qt by yourself in the first place?
-
I need to build qtwebengine because I need to enable proprietary codecs to be able to play mp4 videos. Qtwebengine by default disables proprietary codecs due to licensing. But if I need to use proprietary codecs I have to build it from source with the "-webengine-proprietary-codecs" option. But qtwebengine fails to build. How much memory does QT really need to be built, 100GB of memory seems to be excessive.
https://doc.qt.io/qt-5/qtwebengine-features.html#audio-and-video-codecs
-
@new-user said in Can't build QtWebEngine. Compiler out of heap space error!:
100GB of memory seems to be excessive.
You for sure don't have 100GB of Ram. This is what is to few, not the harddisk size.
-
Do you not know how to solve the problem. Maybe I should report this as a bug in Qt because no software should be using 100GB of ram just to compile.
-
@new-user
Before reporting a bug, could to cd into the qtwebengine source tree and rungit submodule update —recursive
(two minuses, as on my computer this here is displayed as one long minus)
Webengine uses a lot of 3rd party sources. When they are just slightly out of date, you sometimes face strange compiling errors.How much ram do you have? I can build Webengine with 64GB of ram.
-
-
It doesn't matter how much memory I have. No matter how much more memory I add to the system it is still for some weird reason not enough. How did you even build it with 64GB of memory? What version of Qt did you use? What are your compiler flags? What is the size of your page file? What is your build environment?
-
@new-user
I build 6.7 and 6.8 on Linux with 64MB Ram and ample disk space.configure -developer-build -xcb -submodules qtdeclarative, qtwebengine
Have you tried the submodule update?
-
I built qtwebengine successfully but unfortunately it needs a lot of memory to be built it used as mush as 112GB of memory for a few hours of building then memory consumption normalized afterwards. Just by increasing window's page file size it worked. Gracias😀
-
@new-user
It’s a bit sad, that you completely ignore my question about the submodule update. -
If you are using parallel compilation on an AMD ThreadRipper with up to 96 cores, each compilation processes only gets about 1GB of memory if you have ~100GB available. If your PC has many cores, try restricting the number of cores and compilation will become faster (using the pagefile is not a real solution). More cores is not always better.
-
@SimonSchroeder
Wow that is interesting! I assume this applies to any multi-core/processor. So each time I offer use of a core to a process it will divide available memory across cores used and each one (or the new one at least) will only get a limited amount. Having more available cores than available memory sounds like a bad idea! -
Q: Can you please confirm if you have done a submodule update in qtwebengine, as I already asked in the forum?
A: Yes I did run the command "git submodule update --recursive" but no output was shown.
-
Same here.
It needs at least 112 GB memory to build qtwebengine 6.6.1 on windows 10 with MSVC 2022. I was able to finally build it with 50 GB ram + 70 GB pagefile in virtual environment.
Building linux version on ubuntu with gcc was successfull with 8 GB ram+30 GB swap.
It would be better to list memory requirements in prerequisites section of building instructions -
@7erg said in Can't build QtWebEngine. Compiler out of heap space error!:
It needs at least 112 GB memory to build qtwebengine 6.6.1 on windows 10 with MSVC 2022. I was able to finally build it with 50 GB ram + 70 GB pagefile in virtual environment.
OMG!