digitalmars.D - Decrease DMD memory usage
- Marek Janukowicz (5/5) Aug 28 2013 How can I decrease DMD memory usage? My program does now use about 3.5GB...
- Walter Bright (5/8) Aug 29 2013 1. Switch to separately compiling each module, rather than lumping them ...
- Temtaime (3/3) Aug 29 2013 Hi, Walter.
- Iain Buclaw (7/9) Aug 29 2013 The binaries distributed should already be capable of doing that.
- Temtaime (2/2) Aug 29 2013 http://dlang.org/download.html
- Temtaime (1/1) Aug 29 2013 It can compile 64 bit apps, but compiler itself is 32 bit.
- Vladimir Panteleev (4/7) Aug 29 2013 You can compile one yourself, using Visual Studio (the Express
- Benjamin Thaut (6/13) Aug 29 2013 Do you know since when this actually works? I tried this several times
- Brad Anderson (4/21) Aug 29 2013 The cycle is: it works, then it gets broken, then Rainers will
- Temtaime (3/3) Aug 29 2013 Yes, i can. But why Walter cannot compile it and put to downloads?
- Temtaime (13/13) Aug 29 2013 I have ICC license and compiled DMD by it.
- Richard Webb (7/13) Aug 30 2013 It might be that a big chunk of that difference is down to memory
- Jonathan M Davis (7/10) Aug 29 2013 CTFE and templates (especially CTFE) are currently a real killer for mem...
How can I decrease DMD memory usage? My program does now use about 3.5GB during compilation, which is horrible, as even machines with 4GB RAM sometimes fail to compile successfully :( -- Marek Janukowicz
Aug 28 2013
On 8/28/2013 11:53 PM, Marek Janukowicz wrote:How can I decrease DMD memory usage? My program does now use about 3.5GB during compilation, which is horrible, as even machines with 4GB RAM sometimes fail to compile successfully :(1. Switch to separately compiling each module, rather than lumping them all on one command line to dmd. 2. Use the 64 bit dmd build. That won't use less memory, but it handles more memory better, if that makes sense.
Aug 29 2013
Hi, Walter. Where i can get 64 bit dmd for windows that produces 32 bit executables ?
Aug 29 2013
On 29 August 2013 11:09, Temtaime <temtaime gmail.com> wrote:Hi, Walter. Where i can get 64 bit dmd for windows that produces 32 bit executables ?The binaries distributed should already be capable of doing that. Just use the -m32 switch. Whether or not you have 32bit libraries installed to allow linking is another question.... :o) -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0';
Aug 29 2013
http://dlang.org/download.html Here is only 32 bit DMD for windows.
Aug 29 2013
It can compile 64 bit apps, but compiler itself is 32 bit.
Aug 29 2013
On Thursday, 29 August 2013 at 10:09:07 UTC, Temtaime wrote:Hi, Walter. Where i can get 64 bit dmd for windows that produces 32 bit executables ?You can compile one yourself, using Visual Studio (the Express editions are free) and the Visual Studio project/solution files included with the source code.
Aug 29 2013
Am 29.08.2013 16:10, schrieb Vladimir Panteleev:On Thursday, 29 August 2013 at 10:09:07 UTC, Temtaime wrote:Do you know since when this actually works? I tried this several times but always got tons of compile errors. The latest git revision compiles fine on 64 bit though. Kind Regards Benjamin ThautHi, Walter. Where i can get 64 bit dmd for windows that produces 32 bit executables ?You can compile one yourself, using Visual Studio (the Express editions are free) and the Visual Studio project/solution files included with the source code.
Aug 29 2013
On Thursday, 29 August 2013 at 14:12:39 UTC, Benjamin Thaut wrote:Am 29.08.2013 16:10, schrieb Vladimir Panteleev:The cycle is: it works, then it gets broken, then Rainers will make a pull request that fixes it again. Repeat that a couple times between releases.On Thursday, 29 August 2013 at 10:09:07 UTC, Temtaime wrote:Do you know since when this actually works? I tried this several times but always got tons of compile errors. The latest git revision compiles fine on 64 bit though. Kind Regards Benjamin ThautHi, Walter. Where i can get 64 bit dmd for windows that produces 32 bit executables ?You can compile one yourself, using Visual Studio (the Express editions are free) and the Visual Studio project/solution files included with the source code.
Aug 29 2013
Yes, i can. But why Walter cannot compile it and put to downloads? If i compile 64-bit DMD, backend's license forbids me to distribute it?
Aug 29 2013
I have ICC license and compiled DMD by it. I've tried to compile some my projects with it. Some stats: Original DMD: 20 sec. DMD compiled by ICC: 11 sec. x64 DMD compiled by ICC: 14 sec. DMD's memory usage during compilation is about 600 MB. Here is links: http://acomirei.ru/u/dmd.exe http://acomirei.ru/u/dmd_64.exe It is 2.063.2 DMD, so there is no need to compile druntime. Just replace original dmd.exe with it. P.S. Please, remove this links if it forbids backend license.
Aug 29 2013
On 29/08/2013 23:35, Temtaime wrote:I have ICC license and compiled DMD by it. I've tried to compile some my projects with it. Some stats: Original DMD: 20 sec. DMD compiled by ICC: 11 sec. x64 DMD compiled by ICC: 14 sec.It might be that a big chunk of that difference is down to memory handling, as it was for MSVC builds (I think ICC uses the MS C runtimes?). If that is the case, then the difference would be a lot smaller with all the latest bits. Might be interesting to see if the ICC build is any faster than the MSVC build?
Aug 30 2013
Yes, it uses msvc runtimes, but ICC can optimize much more than VC. I've tried to combine DMD with tcmalloc which handles memory allocations better than built-in malloc. My project building duration is 9 sec. This is more than twice faster than DM's DMD without any compiler logic change! http://acomirei.ru/u/dmd_1.exe Okay, i'll try compile DMD with VC 2012 also.
Aug 30 2013
Here is VC build: http://acomirei.ru/u/dmd_2.exe It gives performance about ICC: 9-10 sec. It seems that there is no places in DMD code that ICC can autovectorize.
Aug 30 2013
On Thursday, August 29, 2013 08:53:01 Marek Janukowicz wrote:How can I decrease DMD memory usage? My program does now use about 3.5GB during compilation, which is horrible, as even machines with 4GB RAM sometimes fail to compile successfully :(CTFE and templates (especially CTFE) are currently a real killer for memory, so if you're doing a lot of those, you're going to need a lot of memory when compiling (this will be fixed in time, but that's the way it is right now). So, reducing how much of those you're doing can really help. Probably the simplest thing to do though is simply to not compile everything at once. - Jonathan M Davis
Aug 29 2013