August 20, 2013
On 2013-08-20 13:21, John Colvin wrote:

> Only 2GB
>
> It can work... but I have to close everything else running first,
> otherwise it locks everything up and then crashes out complaining about
> not having enough memory to fork.

Hmm, I'm pretty sure I have compiled Phobos on my MacBook, which only has 2GB.

-- 
/Jacob Carlborg
August 20, 2013
On Tuesday, 20 August 2013 at 13:30:11 UTC, Jacob Carlborg wrote:
> On 2013-08-20 13:21, John Colvin wrote:
>
>> Only 2GB
>>
>> It can work... but I have to close everything else running first,
>> otherwise it locks everything up and then crashes out complaining about
>> not having enough memory to fork.
>
> Hmm, I'm pretty sure I have compiled Phobos on my MacBook, which only has 2GB.

Just from looking at htop while compiling, it looks like it uses approx. 800MB to compile phobos. It's not unusual for me to have a lot less than that free at any given time.

The interesting thing is that it crashes instead of just swapping...
August 20, 2013
On 08/20/2013 12:27 AM, ProgrammingGhost wrote:
>
> Is it possible that if I just try to compile 1 file it could imports
> enough libraries that import/need the definitions for additional large
> libraries which in turn also imports everything causing ram issues? I'm
> sure in practice this will almost never happen. But I don't doubt there
> are main libraries that use other large libraries and everything
> imports/uses everything
> ...

The compiler only has to pull in what is indispensable for semantically analyzing an imported module as far as to determine all relevant type signatures. So while it should be possible to create a project as large that the complete annotated syntax tree exhausts your RAM (projects are not that large in practice), it still would require careful construction of dependencies in order to actually exhaust RAM during separate compilation. (And it is much easier to do so by other means, eg. by instantiating templates in a loop.)
August 20, 2013
On 08/20/2013 08:50 AM, Jacob Carlborg wrote:
> On 2013-08-20 00:27, ProgrammingGhost wrote:
>
>> Is it possible that if I just try to compile 1 file it could imports
>> enough libraries that import/need the definitions for additional large
>> libraries which in turn also imports everything causing ram issues? I'm
>> sure in practice this will almost never happen. But I don't doubt there
>> are main libraries that use other large libraries and everything
>> imports/uses everything
>
> I guess I should add that we do have some problems with RAM running the
> unit tests in Phobos (the standard library). But this is rather due to
> the heavy use of templates and other compile time features. Not because
> there is too much code/text in the files.
>

I was under the impression that this is a limitation of DMD and will be fixed, right?

August 20, 2013
On 2013-08-20 15:35, Timon Gehr wrote:

> I was under the impression that this is a limitation of DMD and will be
> fixed, right?

I think they (Walter, Don, possibly others) are working on it. CTFE apparently does unnecessary copying as well.

-- 
/Jacob Carlborg
1 2
Next ›   Last »