www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Compilation with dub + dmd: out of memory

reply "Vlasov Roman" <vlasovroman.ru yandex.ru> writes:
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?
Feb 10 2015
next sibling parent reply "bearophile" <bearophileHUGS lycos.com> writes:
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
Feb 10 2015
parent reply "Vlasov Roman" <vlasovroman.ru yandex.ru> writes:
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.
Feb 10 2015
next sibling parent reply Daniel =?UTF-8?B?S296w6Fr?= via Digitalmars-d-learn writes:
V Tue, 10 Feb 2015 11:44:09 +0000
Vlasov Roman via Digitalmars-d-learn
<digitalmars-d-learn puremagic.com> 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?
Feb 10 2015
parent reply "Vlasov Roman" <vlasovroman.ru yandex.ru> writes:
On Tuesday, 10 February 2015 at 11:55:43 UTC, Daniel Kozák wrote:
 V Tue, 10 Feb 2015 11:44:09 +0000
 Vlasov Roman via Digitalmars-d-learn
 <digitalmars-d-learn puremagic.com> 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
Feb 10 2015
parent "ddos" <oggs gmx.at> writes:
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 +0000
 Vlasov Roman via Digitalmars-d-learn
 <digitalmars-d-learn puremagic.com> 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
Feb 10 2015
prev sibling parent reply ketmar <ketmar ketmar.no-ip.org> writes:
On Tue, 10 Feb 2015 11:44:09 +0000, 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
=20 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?=20 run "dub -v" and see the command lines. you'll be very surprised.=
Feb 10 2015
parent reply "Vlasov Roman" <vlasovroman.ru yandex.ru> writes:
On Tuesday, 10 February 2015 at 12:42:07 UTC, ketmar wrote:
 On Tue, 10 Feb 2015 11:44:09 +0000, 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.
Feb 10 2015
parent ketmar <ketmar ketmar.no-ip.org> writes:
On Tue, 10 Feb 2015 13:03:14 +0000, 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=20 that libraries are very big. but once that libraries are built, you may=20 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=3DsingleFile" mode?=
Feb 10 2015
prev sibling next sibling parent "Mathias LANG" <geod24 gmail.com> writes:
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).
Feb 10 2015
prev sibling parent "Per =?UTF-8?B?Tm9yZGzDtnci?= <per.nordlow gmail.com> writes:
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.
Feb 10 2015