Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread ddos via Digitalmars-d-learn

On Tuesday, 10 February 2015 at 12:18:15 UTC, Vlasov Roman wrote:
On Tuesday, 10 February 2015 at 11:55:43 UTC, Daniel Kozák 
wrote:

V Tue, 10 Feb 2015 11:44:09 +
Vlasov Roman via Digitalmars-d-learn
 napsáno:

On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile 
wrote:

> Vlasov Roman:
>
>> I have the quite computer with 2 GB RAM. At compilation 
>> with dub and dmd of small project this pair eating about 
>> 1.4~1.5 GB RAM. I solve this probleb by connecting swap 
>> partition, but it calls some freezes + it take ~10% of 
>> swap, and after compilation swap not released. At 
>> switching off swap as result we get ~200 MB of "dead data" 
>> in RAM, which can be released by rebooting. How i can 
>> resolve it?

>
> Look for CTFE code, perhaps some of it is excessive. You 
> can convert some of it to run-time in a module-level static 
> this().

>
> Bye,
> bearophile

I think you don't understand me. 1.4~1.5 GB taked by 
compilator at compilation my project in 100 string of code in 
3 modules.




Still it could be code dependent, can you share your code 
anywhere?


https://bitbucket.org/VlasovRoman/ogl/overview


a bit offtopic from your thread but maybe you are interested ...
at vienna university of technology i attended a similar software
rendering course,
some resources are publicly available (and in english)
https://lva.cg.tuwien.ac.at/ecg/wiki/doku.php

some impressions from previous years entries:
https://lva.cg.tuwien.ac.at/ecg/wiki/doku.php?id=students:ws2013:hall_of_fame


Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread ketmar via Digitalmars-d-learn
On Tue, 10 Feb 2015 13:03:14 +, Vlasov Roman wrote:

> Whether correctly I understand that the problem is that my dependences
> have other dependences which are compiled with my project?

dub tries to build the libraries your project depends on, and some of 
that libraries are very big. but once that libraries are built, you may 
be able to build your project in one go.

> Yes, i very surpriced, because i use only 1-2 "shared" modules.
> So, i can copy this modules just in my project, but in big projects this
> problem can be very serious.

did you tried the proposed "--build-mode=singleFile" mode?

signature.asc
Description: PGP signature


Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread Vlasov Roman via Digitalmars-d-learn

On Tuesday, 10 February 2015 at 12:42:07 UTC, ketmar wrote:

On Tue, 10 Feb 2015 11:44:09 +, Vlasov Roman wrote:


On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile wrote:

Vlasov Roman:

I have the quite computer with 2 GB RAM. At compilation with 
dub and
dmd of small project this pair eating about 1.4~1.5 GB RAM. 
I solve
this probleb by connecting swap partition, but it calls some 
freezes +
it take ~10% of swap, and after compilation swap not 
released. At
switching off swap as result we get ~200 MB of "dead data" 
in RAM,

which can be released by rebooting. How i can resolve it?


Look for CTFE code, perhaps some of it is excessive. You can 
convert

some of it to run-time in a module-level static this().

Bye,
bearophile


I think you don't understand me. 1.4~1.5 GB taked by 
compilator at

compilation my project in 100 string of code in 3 modules.


  "fileVersion": 1,
  "versions": {
"dunit": "1.0.10",
"descore": "1.2.0",
"derelict-ft": "1.0.2",
"derelict-util": "1.9.1",
"tga": "0.1.0",
"des": "1.3.3",
"derelict-sdl2": "1.9.1",
"derelict-gl3": "1.0.12"
  }

wow-wow, do you REALLY expect all that to compile with few megs 
of RAM?
run "dub -v" and see the command lines. you'll be very 
surprised.


Whether correctly I understand that the problem is that my 
dependences have other dependences which are compiled with my 
project?
Yes, i very surpriced, because i use only 1-2 "shared" modules. 
So, i can copy this modules just in my project, but in big 
projects this problem can be very serious.




Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread ketmar via Digitalmars-d-learn
On Tue, 10 Feb 2015 11:44:09 +, Vlasov Roman wrote:

> On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile wrote:
>> Vlasov Roman:
>>
>>> I have the quite computer with 2 GB RAM. At compilation with dub and
>>> dmd of small project this pair eating about 1.4~1.5 GB RAM. I solve
>>> this probleb by connecting swap partition, but it calls some freezes +
>>> it take ~10% of swap, and after compilation swap not released. At
>>> switching off swap as result we get ~200 MB of "dead data" in RAM,
>>> which can be released by rebooting. How i can resolve it?
>>
>> Look for CTFE code, perhaps some of it is excessive. You can convert
>> some of it to run-time in a module-level static this().
>>
>> Bye,
>> bearophile
> 
> I think you don't understand me. 1.4~1.5 GB taked by compilator at
> compilation my project in 100 string of code in 3 modules.

  "fileVersion": 1,
  "versions": {
"dunit": "1.0.10",
"descore": "1.2.0",
"derelict-ft": "1.0.2",
"derelict-util": "1.9.1",
"tga": "0.1.0",
"des": "1.3.3",
"derelict-sdl2": "1.9.1",
"derelict-gl3": "1.0.12"
  }

wow-wow, do you REALLY expect all that to compile with few megs of RAM? 
run "dub -v" and see the command lines. you'll be very surprised.

signature.asc
Description: PGP signature


Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread Vlasov Roman via Digitalmars-d-learn

On Tuesday, 10 February 2015 at 11:55:43 UTC, Daniel Kozák wrote:

V Tue, 10 Feb 2015 11:44:09 +
Vlasov Roman via Digitalmars-d-learn
 napsáno:


On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile wrote:
> Vlasov Roman:
>
>> I have the quite computer with 2 GB RAM. At compilation 
>> with dub and dmd of small project this pair eating about 
>> 1.4~1.5 GB RAM. I solve this probleb by connecting swap 
>> partition, but it calls some freezes + it take ~10% of 
>> swap, and after compilation swap not released. At switching 
>> off swap as result we get ~200 MB of "dead data" in RAM, 
>> which can be released by rebooting. How i can resolve it?

>
> Look for CTFE code, perhaps some of it is excessive. You can 
> convert some of it to run-time in a module-level static 
> this().

>
> Bye,
> bearophile

I think you don't understand me. 1.4~1.5 GB taked by 
compilator at compilation my project in 100 string of code in 
3 modules.




Still it could be code dependent, can you share your code 
anywhere?


https://bitbucket.org/VlasovRoman/ogl/overview



Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread Daniel Kozák via Digitalmars-d-learn
V Tue, 10 Feb 2015 11:44:09 +
Vlasov Roman via Digitalmars-d-learn
 napsáno:

> On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile wrote:
> > Vlasov Roman:
> >
> >> I have the quite computer with 2 GB RAM. At compilation with 
> >> dub and dmd of small project this pair eating about 1.4~1.5 GB 
> >> RAM. I solve this probleb by connecting swap partition, but it 
> >> calls some freezes + it take ~10% of swap, and after 
> >> compilation swap not released. At switching off swap as result 
> >> we get ~200 MB of "dead data" in RAM, which can be released by 
> >> rebooting. How i can resolve it?
> >
> > Look for CTFE code, perhaps some of it is excessive. You can 
> > convert some of it to run-time in a module-level static this().
> >
> > Bye,
> > bearophile
> 
> I think you don't understand me. 1.4~1.5 GB taked by compilator 
> at compilation my project in 100 string of code in 3 modules.
> 

Still it could be code dependent, can you share your code anywhere?



Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread via Digitalmars-d-learn

On Tuesday, 10 February 2015 at 11:24:21 UTC, Vlasov Roman wrote:
I have the quite computer with 2 GB RAM. At compilation with 
dub and dmd of small project this pair eating about 1.4~1.5 GB 
RAM.


DMD 2.067 will have memory (an in turn speed) optimizations in 
CTFE.


Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread Vlasov Roman via Digitalmars-d-learn

On Tuesday, 10 February 2015 at 11:32:32 UTC, bearophile wrote:

Vlasov Roman:

I have the quite computer with 2 GB RAM. At compilation with 
dub and dmd of small project this pair eating about 1.4~1.5 GB 
RAM. I solve this probleb by connecting swap partition, but it 
calls some freezes + it take ~10% of swap, and after 
compilation swap not released. At switching off swap as result 
we get ~200 MB of "dead data" in RAM, which can be released by 
rebooting. How i can resolve it?


Look for CTFE code, perhaps some of it is excessive. You can 
convert some of it to run-time in a module-level static this().


Bye,
bearophile


I think you don't understand me. 1.4~1.5 GB taked by compilator 
at compilation my project in 100 string of code in 3 modules.




Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread Mathias LANG via Digitalmars-d-learn

On Tuesday, 10 February 2015 at 11:24:21 UTC, Vlasov Roman wrote:
I have the quite computer with 2 GB RAM. At compilation with 
dub and dmd of small project this pair eating about 1.4~1.5 GB 
RAM. I solve this probleb by connecting swap partition, but it 
calls some freezes + it take ~10% of swap, and after 
compilation swap not released. At switching off swap as result 
we get ~200 MB of "dead data" in RAM, which can be released by 
rebooting. How i can resolve it?


First, if the program terminated, there is no dead data. Some 
might be shown as used with utilities as top, but running 'free' 
will probably show that your data is still "buffered", but 
available for other programs to use.

You can run this command to see the effect of dropping cache:
free && sync && echo 3 > /proc/sys/vm/drop_caches && free

Back to dub... DMD way of managing memory is fast, at the expense 
of memory. I could not really enjoy fast compile time on my 4 GB 
machine either, everything changed when I switched to 8 GB.
There is an option in dub to compile every object file 
separately, it's '--build-mode=singleFile'. However, it has no 
tracking of updated files (as make as), so it rebuild everything, 
everytime. It makes the whole process slower, but you can use it 
if you run out of memory (I compiled Vibe.d on a 512 MB machine 
few months ago).


Re: Compilation with dub + dmd: out of memory

2015-02-10 Thread bearophile via Digitalmars-d-learn

Vlasov Roman:

I have the quite computer with 2 GB RAM. At compilation with 
dub and dmd of small project this pair eating about 1.4~1.5 GB 
RAM. I solve this probleb by connecting swap partition, but it 
calls some freezes + it take ~10% of swap, and after 
compilation swap not released. At switching off swap as result 
we get ~200 MB of "dead data" in RAM, which can be released by 
rebooting. How i can resolve it?


Look for CTFE code, perhaps some of it is excessive. You can 
convert some of it to run-time in a module-level static this().


Bye,
bearophile