Re: Error: out of memory

2018-01-10 Thread Paolo Invernizzi via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 19:21:21 UTC, Adam D. Ruppe 
wrote:

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:

I don't see a 64 bit release though... might have to try to 
build it yourself from source using visual studio.


It's a long time I don't understand why there's not a 64bit 
distribution...

(along with a debug build of rt/phobos, btw)

/Paolo


Re: Error: out of memory

2018-01-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 10, 2018 at 07:21:21PM +, Adam D. Ruppe via Digitalmars-d-learn 
wrote:
[...]
> (and ugh dmd REALLY needs to get its memory consumption under control!
> maybe just enabling the GC would help sometimes.)

Yeah, no kidding!  Recently I also ran into trouble with dmd's memory
consumption competing with Firefox, another big, fat memory hog.  I had
to kill the Firefox process just so I have enough free RAM for dmd not
to bail out in the middle of compilation.

While the latest D motto seems to be fast, fast, and faster, fast does
you no good if you can't even finish compilation in the first place.  We
need to have an option to turn on the GC and/or otherwise push dmd
toward the memory end of the speed/memory tradeoff, instead of being
stuck up fast creek without a memory paddle.


T

-- 
Tell me and I forget. Teach me and I remember. Involve me and I understand. -- 
Benjamin Franklin


Re: Error: out of memory

2018-01-10 Thread Anonymouse via Digitalmars-d-learn
On Wednesday, 10 January 2018 at 19:21:21 UTC, Adam D. Ruppe 
wrote:

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:
I want to test it on a Windows 10 PC now but compilation with 
dmd (2.078.1) fails, both with --arch x86 and x86_64. LDC 
works, but it easily takes twice the time to build.


In both cases, it is running a 32 bit dmd, just generating 64 
bit code.


I don't see a 64 bit release though... might have to try to 
build it yourself from source using visual studio.


(and ugh dmd REALLY needs to get its memory consumption under 
control! maybe just enabling the GC would help sometimes.)


Ugh, okay. Thanks, I'll try that.


Re: Error: out of memory

2018-01-10 Thread Anonymouse via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:
I've been building and testing my project on linux, juggling 
the ~5GB+ RAM needed to actually compile, but it's been working.


I want to test it on a Windows 10 PC now but compilation with 
dmd (2.078.1)


That's naturally supposed to be 2.078.0.


Re: Error: out of memory

2018-01-10 Thread Adam D. Ruppe via Digitalmars-d-learn

On Wednesday, 10 January 2018 at 19:15:00 UTC, Anonymouse wrote:
I want to test it on a Windows 10 PC now but compilation with 
dmd (2.078.1) fails, both with --arch x86 and x86_64. LDC 
works, but it easily takes twice the time to build.


In both cases, it is running a 32 bit dmd, just generating 64 bit 
code.


I don't see a 64 bit release though... might have to try to build 
it yourself from source using visual studio.


(and ugh dmd REALLY needs to get its memory consumption under 
control! maybe just enabling the GC would help sometimes.)


Re: Error: out of memory

2017-03-19 Thread Era Scarecrow via Digitalmars-d-learn

On Saturday, 18 March 2017 at 20:39:20 UTC, StarGrazer wrote:
I have some CTFE's and meta programming that cause dmd to run 
out of memory ;/


I am generating simple classes, but a lot of them. dmd uses 
about 2GB before it quits. It also only uses about 12% of cpu.


 I've noticed heavy use of foreach and temporary variables will 
end up wiping out a lot of your memory using CTFE... At which 
point using a different for loop might be a better idea.


Re: Error: out of memory

2017-03-19 Thread Stefan Koch via Digitalmars-d-learn

On Saturday, 18 March 2017 at 20:39:20 UTC, StarGrazer wrote:
I have some CTFE's and meta programming that cause dmd to run 
out of memory ;/


I am generating simple classes, but a lot of them. dmd uses 
about 2GB before it quites. It also only uses about 12% of cpu.


I have 16 GB total memory and about that free. Surely dmd could 
do a better job? Any way to get it to do such a thing like set 
the maximum amount of memory it can use?


Can you submit this code for analysis ?


Re: Error: out of memory

2017-03-19 Thread XavierAP via Digitalmars-d-learn

On Sunday, 19 March 2017 at 20:50:50 UTC, Gand Alf wrote:


just use DMD with the -m64 parameter ;)


then you should get a x64 DMD


No, at least afaik, then you tell DMD to make a x64 exe, but DMD 
itself (this particular Windows version) is still a 32-bit exe.


Re: Error: out of memory

2017-03-19 Thread Gand Alf via Digitalmars-d-learn

On Sunday, 19 March 2017 at 20:49:02 UTC, Gand Alf wrote:

On Saturday, 18 March 2017 at 23:24:40 UTC, kinke wrote:
The Win64 LDC releases 
[https://github.com/ldc-developers/ldc/releases] feature a 
64-bit compiler.


just use DMD with the -m64 parameter ;)


then you should get a x64 DMD


Re: Error: out of memory

2017-03-19 Thread Gand Alf via Digitalmars-d-learn

On Saturday, 18 March 2017 at 23:24:40 UTC, kinke wrote:
The Win64 LDC releases 
[https://github.com/ldc-developers/ldc/releases] feature a 
64-bit compiler.


just use DMD with the -m64 parameter ;)


Re: Error: out of memory

2017-03-18 Thread kinke via Digitalmars-d-learn
The Win64 LDC releases 
[https://github.com/ldc-developers/ldc/releases] feature a 64-bit 
compiler.


Re: Error: out of memory

2017-03-18 Thread XavierAP via Digitalmars-d-learn

On Saturday, 18 March 2017 at 20:39:20 UTC, StarGrazer wrote:


about 2GB before it quites. It also only uses about 12% of cpu.

I have 16 GB total memory and about that free. Surely dmd could 
do a better job? Any way to get it to do such a thing like set 
the maximum amount of memory it can use?


Any 32-bit process gets 2 GB of memory space, regardless of how 
much physical memory you have.


https://msdn.microsoft.com/library/aa366778.aspx

If you used a 64-bit version of dmd your problems should go 
away... If the binary for Windows isn't available from the 
downloads here, you can try compiling it from source yourself... 
But I'm sure someone somewhere has done it already. Or you can 
try another compiler such as GDC, which is available for Windows 
x64.


Also 12.5% probably means 100% of one of 8 cores in your CPU.


Re: Error: out of memory

2017-03-18 Thread Basile B. via Digitalmars-d-learn

On Saturday, 18 March 2017 at 20:56:47 UTC, StarGrazer wrote:

On Saturday, 18 March 2017 at 20:43:29 UTC, Basile B. wrote:

On Saturday, 18 March 2017 at 20:39:20 UTC, StarGrazer wrote:
I have some CTFE's and meta programming that cause dmd to run 
out of memory ;/


I am generating simple classes, but a lot of them. dmd uses 
about 2GB before it quites. It also only uses about 12% of 
cpu.


I have 16 GB total memory and about that free. Surely dmd 
could do a better job? Any way to get it to do such a thing 
like set the maximum amount of memory it can use?


DMD32 under win ?


I guess. Whatever the dmd is from the download page. Yes, under 
windows.


32bit processes have a limited access to the ram. Over your 16Gb 
only 2^^31 can be used. Add even this amount is likely to be 
reduced by the memory fragmentation.


In the future you'll be able to do more. Current CTFE engine has 
a suboptimal memory system, which will be changed in 2.075.
See 
https://dlang.org/blog/2016/11/18/project-highlight-the-new-ctfe-engine/, which explains more the memory thing.


Re: Error: out of memory

2017-03-18 Thread StarGrazer via Digitalmars-d-learn

On Saturday, 18 March 2017 at 20:43:29 UTC, Basile B. wrote:

On Saturday, 18 March 2017 at 20:39:20 UTC, StarGrazer wrote:
I have some CTFE's and meta programming that cause dmd to run 
out of memory ;/


I am generating simple classes, but a lot of them. dmd uses 
about 2GB before it quites. It also only uses about 12% of cpu.


I have 16 GB total memory and about that free. Surely dmd 
could do a better job? Any way to get it to do such a thing 
like set the maximum amount of memory it can use?


DMD32 under win ?


I guess. Whatever the dmd is from the download page. Yes, under 
windows.




Re: Error: out of memory

2017-03-18 Thread Basile B. via Digitalmars-d-learn

On Saturday, 18 March 2017 at 20:39:20 UTC, StarGrazer wrote:
I have some CTFE's and meta programming that cause dmd to run 
out of memory ;/


I am generating simple classes, but a lot of them. dmd uses 
about 2GB before it quites. It also only uses about 12% of cpu.


I have 16 GB total memory and about that free. Surely dmd could 
do a better job? Any way to get it to do such a thing like set 
the maximum amount of memory it can use?


DMD32 under win ?