mir-algorithm icon indicating copy to clipboard operation
mir-algorithm copied to clipboard

Mir Algorithm takes an absurd amount of memory to build

Open hatf0 opened this issue 2 years ago • 3 comments

In the process of building Mir Algorithm's unittests, I'm frequently running into situations where dub exits with -9 (indicating that my system has run out of memory). After further examination, dmd is using 6+ GB of RAM when trying to build the unittests (this is also with -lowmem). Screen-Shot-2021-12-08-12-10-54

This is killing me over here -- I only run a MBP with 16 GB of RAM (subject to upgrade), and I'm getting spurious build issues due to running out of memory.

hatf0 avatar Dec 08 '21 17:12 hatf0

How is ldc2 with -lowmem? You can turn off most of the tests. They are wrapped with version.

9il avatar Dec 08 '21 17:12 9il

LDC has the same problem (spikes up to 7 GB before running into an OOM): Screen-Shot-2021-12-08-12-39-55

Disabling the unittests under version (mir_test) fixes this, but this problem is a huge pain...

hatf0 avatar Dec 08 '21 17:12 hatf0

@hatf0 When I'm developing on mir-algorithm (yesh, it has been a while), I usually change the unittests that are relevant to me (including new ones) to some other version specifier and only run dub test for that as I need it. This particularly works well for orthogonal new features.

Admittedly, it might make sense to create a separate tests folder and move anything that is not a documentation unit test to that folder. Another approach might be to give the documentation unit tests a separate version identifier so that you can test with some smaller coverage.

jmh530 avatar Dec 08 '21 18:12 jmh530