https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124353
Bug ID: 124353
Summary: [16 regression] High memory usage building
nodejs-24.11.1
Product: gcc
Version: 16.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sjames at gcc dot gnu.org
Target Milestone: ---
Created attachment 63821
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=63821&action=edit
v8_compiler.csa-optimize-phase.ii.xz
This seems to have started in the last few weeks at most. I observed it get up
to 3.4GB, while most of nodejs is 1.5-2GB.
```
Command being timed: "x86_64-pc-linux-gnu-g++ -MMD -MF
obj/deps/v8/src/compiler/turboshaft/v8_compiler.csa-optimize-phase.o.d
-D_GLIBCXX_USE_CXX11_ABI=1 -D_FILE_OFFSET_BITS=64
-DNODE_OPENSSL_CONF_NAME=nodejs_conf -DNODE_OPENSSL_CERT_STORE
-DICU_NO_USER_DATA_OVERRIDE -DV8_GYP_BUILD -DV8_TYPED_ARRAY_MAX_SIZE_IN_HEAP=64
-D__STDC_FORMAT_MACROS -DV8_TARGET_ARCH_X64 -DV8_HAVE_TARGET_OS
-DV8_TARGET_OS_LINUX -DV8_EMBEDDER_STRING="-node.27" -DENABLE_DISASSEMBLER
-DV8_PROMISE_INTERNAL_FIELD_COUNT=1
-DV8_ENABLE_PRIVATE_MAPPING_FORK_OPTIMIZATION -DV8_SHORT_BUILTIN_CALLS
-DOBJECT_PRINT -DV8_INTL_SUPPORT -DV8_ATOMIC_OBJECT_FIELD_WRITES
-DV8_ENABLE_LAZY_SOURCE_POSITIONS -DV8_USE_SIPHASH -DNDEBUG
-DV8_WIN64_UNWINDING_INFO -DV8_ENABLE_REGEXP_INTERPRETER_THREADED_DISPATCH
-DV8_USE_ZLIB -DV8_ENABLE_LEAPTIERING -DV8_ENABLE_SPARKPLUG -DV8_ENABLE_MAGLEV
-DV8_ENABLE_TURBOFAN -DV8_ENABLE_WEBASSEMBLY
-DV8_ENABLE_JAVASCRIPT_PROMISE_HOOKS
-DV8_ENABLE_CONTINUATION_PRESERVED_EMBEDDER_DATA -DV8_ALLOCATION_FOLDING
-DV8_ALLOCATION_SITE_TRACKING -DV8_ADVANCED_BIGINT_ALGORITHMS
-DV8_ENABLE_WASM_SIMD256_REVEC -I../../deps/v8 -I../../deps/v8/include
-Igen/generate-bytecode-output-root -Igen
-I../../deps/v8/third_party/fp16/src/include
-I../../deps/v8/third_party/abseil-cpp -pthread -Wno-unused-parameter
-Wno-strict-overflow -Wno-return-type -Wno-int-in-bool-context -Wno-deprecated
-Wno-stringop-overflow -Wno-stringop-overread -Wno-restrict -Wno-array-bounds
-Wno-nonnull -Wno-dangling-pointer -flax-vector-conversions -m64
-fno-omit-frame-pointer -fdata-sections -ffunction-sections -O3 -O3
-march=native -fno-semantic-interposition -g1 -pipe -fcf-protection=none
-fdiagnostics-color=always -fdiagnostics-urls=never -frecord-gcc-switches
-fdiagnostics-show-context=3 -Wa,-O2 -Wa,-mtune=znver2 -Warray-bounds
--param=ggc-min-expand=120 -Wstrict-aliasing -Wfree-nonheap-object
-Wuninitialized -Wmaybe-uninitialized -Wreturn-type -Werror=lto-type-mismatch
-Werror=strict-aliasing -Werror=odr -Warray-bounds -Wstringop-overread
-Wstringop-overflow -Wstringop-truncation -Wformat-overflow -Wformat-truncation
-Wrestrict -Wformat -Werror=format-security -Wno-template-id-cdtor -fno-rtti
-fno-exceptions -fno-strict-aliasing -std=gnu++20 -Wno-invalid-offsetof -c
../../deps/v8/src/compiler/turboshaft/csa-optimize-phase.cc -o
obj/deps/v8/src/compiler/turboshaft/v8_compiler.csa-optimize-phase.o"
User time (seconds): 82.75
System time (seconds): 1.49
Percent of CPU this job got: 100%
Elapsed (wall clock) time (h:mm:ss or m:ss): 1:23.96
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 3562516
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 20
Minor (reclaiming a frame) page faults: 1008644
Voluntary context switches: 5551
Involuntary context switches: 1503
Swaps: 0
File system inputs: 2152
File system outputs: 19624
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0
```
```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,cobol,algol68,m2,rust,jit
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 16.0.9999 p, commit
fce599abdf3636cf28c4f3396bb8c889166553a9' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch
--enable-linker-build-id --enable-libada --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-tls=gnu2 --enable-multilib
--with-multilib-list=m32,mx32,m64 --disable-fixed-point --with-abi=m64
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--disable-cet --enable-systemtap --enable-valgrind-annotations
--enable-valgrind-interop --disable-vtable-verify --disable-libvtv --with-zstd
--with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-host-shared
--enable-libgdiagnostics --with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260227 (experimental)
f23a339a686ed6cc6a4838459bc220e48ba901cb (Gentoo Hardened 16.0.9999 p, commit
fce599abdf3636cf28c4f3396bb8c889166553a9)
```