[Issue 22330] New: Huge memory consumption for optimized DMD builds with LDC host compiler
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Sep 22 16:16:52 UTC 2021
https://issues.dlang.org/show_bug.cgi?id=22330
Issue ID: 22330
Summary: Huge memory consumption for optimized DMD builds with
LDC host compiler
Product: D
Version: D2
Hardware: x86_64
OS: Linux
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: kinke at gmx.net
For a pretty large private project, I've noticed that optimized DMD built with
LDC host compilers can require almost twice as much memory (peak working set
shown by /usr/bin/time -v) than unoptimized DMD builds. This is with DMD
v2.097.2 on Linux x64; using itself as host compiler doesn't show this
behavior. I've tested LDC v1.27.0, v1.25.1 and v1.21.0 as host compilers (incl.
different LLVM versions), the behavior is consistent.
With -o-, the memory consumption is ~17 GB with all DMD builds.
With -c, it's still ~17 GB for all builds with DMD host compilers and the
unoptimized LDC host compiler build. With the ENABLE_RELEASE=1 LDC host
compiler build, it's almost 19 GB.
With -lib, it's still around 17 GB for all builds *except* the LDC-optimized
build, where it explodes to almost 31 GB. With official DMD v2.097.2, it's
around 29 GB (not sure how that's built exactly).
I hope this strangeness can be reproduced with arbitrary non-tiny projects. The
fact that -o- is stable appears to confine it to the DMD glue/codegen layer. I
cannot rule out that LDC is to blame, but I guess it's more likely that
something's off in the DMD backend code.
--
More information about the Digitalmars-d-bugs
mailing list