[cfe-dev] newbie

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Wed Mar 7 06:31:53 PST 2018


Despite having 32GB of RAM (and not much swap-space), building a debug
version of LLVM + Clang with -j N, and having N > ~10 will make my machine
almost stop (to the level where I hit a key and it takes several seconds to
respond to that single keypress).

Non-debug builds are much less memory hungry, but of course if you actually
want to debug your own code when it crashes inside some LLVM function
(becasue you passed in something bad), it is a lot harder. I have both
release and debug builds on my machine, for that very reason.

--
Mats

On 6 March 2018 at 23:20, via cfe-dev <cfe-dev at lists.llvm.org> wrote:

> Hi Chris,
>
> My experience is that by far the peak memory consumption occurs during
> linking.  Compilations don't use much.  And debug configurations seriously
> increase memory consumption during linking.  This means, perversely, that
> it's likely faster to do a Release build than a Debug build.  I basically
> never do a Debug build because it takes too long.
>
> I am curious what configuration you used (probably Debug?) and how many
> parallel threads you had.  Because linking is the memory hog, you might try
> using '-DLLVM_PARALLEL_LINK_JOBS=1'  which might help avoid swapping (which
> *seriously* slows down a build).
>
> HTH,
>
> --paulr
>
>
>
> P.S. Yeah, some cautionary words about memory consumption seem like a good
> idea.
>
>
>
> *From:* cfe-dev [mailto:cfe-dev-bounces at lists.llvm.org] *On Behalf Of *Chris
> Moller via cfe-dev
> *Sent:* Tuesday, March 06, 2018 8:38 AM
> *To:* cfe-dev at lists.llvm.org
> *Subject:* [cfe-dev] newbie
>
>
>
> I just found clang/llvm a few days ago.  It looks very cool, but if you
> don't mind a right-off-the-bat observation, somewhere in the Unix-like
> build recipe it would be very handy if you'd caution new users about the
> memory size need to build clang.  My machine has 4GB of RAM and I had
> another 4GB of swap space--and that wasn't enough.  Another 4GB of swap
> wasn't enough.  Ultimately, I  had to tick it up to a total of 10GB of
> swap--monitoring things with the "top" utility, the biggest memory
> requirement I saw was just a little short of 11GB.
>
> In Fedora Linux, it's easy enough to create temporary additional swap
> spaces, but I've no idea, if it's not the same, how to do that in other
> distros.
>
> Anyway, cool stuff, and I'm looking forward to fiddling with it.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180307/c39cc43a/attachment.html>


More information about the cfe-dev mailing list