Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: C++ compiler excessive memory usage?



On Mon, Oct 12, 2026 at 14:48:50 +0200, Havard Eidnes wrote:

> In short, the issue I am observing is that the C++ compiler is
> consuming extraordinary amounts of virtual memory while building
> 
> lib/Target/RISCV/CMakeFiles/LLVMRISCVCodeGen.dir/GISel/RISCVInstructionSelector.cpp
> 
[...]
> So... The ask: can anyone with better C++ abilities than me take a
> look at what is so peculiar about this particular file that it
> causes this excessive resource consumption by the cc1plus compiler
> component?

Make sure the build doesn't do something like -fkeep-inline-functions
(or whatever its clang counterpart is).  Building Self (the language
that javascript got the inspiration from and java got its hotspot vm)
used to take ages and each object file was measured in the hundreds of
kilobytes, b/c each object file ended up with copies of every inline
method in every class #include'd in the source.  Then another eternity
would be spent by the linker g/c'ing/coalescing all the hundres of
copies of those methods found in each .o file.

-uwe


Home | Main Index | Thread Index | Old Index