Re: devel/llvm13 failed to reclaim memory on 8 GB Pi4 running -current [UFS context: used the whole swap space too]

From: Mark Millard <marklmi_at_yahoo.com>
Date: Sat, 29 Jan 2022 00:33:11 UTC
On 2022-Jan-28, at 16:20, bob prohaska <fbsd@www.zefox.net> wrote:

> On Fri, Jan 28, 2022 at 03:05:06PM -0800, Mark Millard wrote:
>> 
>> I'll set things up for swap totaling to 30 GiBytes, reboot,
>> and start it again. This will hopefully let me see and
>> report MaxObs??? figures for a successful build when there
>> is RAM+SWAP: 38 GiBytes. So: more than 9 GiBytes per compiler
>> instance (mean).
>> 
> 
> Am I mistaken to think there's been a drastic and abrupt increase
> in memory needed to compile clang13 and friends? 
> 

Not that I know of.

I've still never managed to repeat your RPi3B + 2 GiByte SWAP
problem (.cpp and .sh example). I'm still trying.

At this point I've still no clue what is going on.

One thing that you could check is the content of
/usr/src/lib/googletest/tests/Makefile.inc . It
should look like (up to email whitespace oddities):

QUOTE
# $FreeBSD$

.include "../Makefile.inc"
# Keep the existing tests directory structure (with subdirs per component)
# rather than installing all of them to /usr/tests/lib/googletest
TESTSDIR=       ${TESTSBASE}/lib/googletest/${.CURDIR:T}

# Clang's optimizer spends a really long time on these tests at -O2. Changing
# -O2 to -O1 reduces the -j32 time for lib/googletest/test from 131s to 71s.
# Using -O0 further reduces the time to 29s, and also reduces the disk usage
# from 144MB (at -O2) / 92MB (at -O1) to 82MB, so we use -O0.
# Note: Building without debug info saves about 10-15% of the build time, so we
# only enable debug info if DEBUG_FLAGS is not empty (71s -> 64s at -O1 and -j32).
CFLAGS.clang+=  -O0
.if empty(DEBUG_FLAGS)
MK_DEBUG_FILES:=no
CFLAGS.clang+=  -g0
.endif
END QUOTE

The part of it that has:

CFLAGS.clang+=  -O0
.if empty(DEBUG_FLAGS)
MK_DEBUG_FILES:=no
CFLAGS.clang+=  -g0
.endif

is important to limiting memory use for building
googletest.

It is also important to not have done anything that
forces -O2 for some parts of googletest.

As I remember, this issue predates clang13 but still
applies.



===
Mark Millard
marklmi at yahoo.com