www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18843] New: -deps -unittest causes cataclysmic memory usage

https://issues.dlang.org/show_bug.cgi?id=18843

          Issue ID: 18843
           Summary: -deps -unittest causes cataclysmic memory usage
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: default_357-line yahoo.de

In case you think I'm exaggerating:

echo 'import std.stdio; void main() { writeln("Hello World"); }' > helloworld.d
/usr/bin/time -v dmd -deps -unittest helloworld.d
[...]
        User time (seconds): 27.24
[...]
        Maximum resident set size (kbytes): 11550624

That's 11 gigabytes rss for Hello World.

The background issue is that -deps -unittest forces DMD to recurse into Phobos
unittests and all their imports, eventually semantically evaluating every
single unittest in Phobos.

Quickfur had a good proposal in https://github.com/dlang/phobos/pull/6159 ,
that may generalize to -deps: only consider files that are explicitly listed on
the command line. That may help.

--
May 08 2018