On Saturday, 7 November 2015 at 13:25:41 UTC, Jonathan M Davis wrote:
What can we do when it eats up all 4 gigs? (Windows)

With any program, if you're hitting the limit of the 32-bit address space (which is actually more like 3.6 GiB than 4), then you really only have two options - use less memory or go to 64-bit. In the case of dmd specifically, that means either reducing how much memory dmd consumes (which would mean improvements to the dmd codebase), have a 64-bit build of dmd (I have no idea what's involved with that, though it sounds like it's been done before), or you have to build your program in separate pieces that each require a low enough amount of memory when compiling that they don't run out of memory. Phobos has been built in pieces for quite a while now specifically because it requires too much memory to build it all at once (std.algorithm alone requires a lot of memory thanks to all of the template instantiations in its unit tests).

- Jonathan M Davis

With a codebase like phobos, compiling in several steps isn't a bad solution. But I am building a parser using pegged, and splitting up the grammar into different modules feels like a no-no. It's an option though.

Right now I run compile with gdc in a virtual machine. Still eats about 7 gigs.

The 64bit dmd would be nice. I waved the idea goodbye when I couldn't find a download link. Maybe need to look into it.

Reply via email to