Re: Tweakig -lowmem to be more eager

2019-05-21 Thread Anonymouse via Digitalmars-d-learn

On Monday, 20 May 2019 at 13:41:15 UTC, Boris-Barboris wrote:

On Sunday, 19 May 2019 at 23:54:27 UTC, Anonymouse wrote:

What makes it decide to collect? What triggers it?


You can try setting heapSizeFactor option to something lower 
than 2 to increase collection frequency:

https://github.com/dlang/druntime/blob/47b03c14a1097d28afcf22f645628ba4046377bd/src/core/gc/config.d#L26
https://dlang.org/spec/garbage.html#gc_config

dmd appears to respect DRT_GCOPT environment variable.


This does look like what I need. I'm having no luck with 
DRT_GCOPT though.


$ dmd "--DRT-gcopt=heapSizeFactor=1.5 profile:1" hello.d
Number of collections:  2
Total GC prep time:  0 milliseconds
Total mark time:  0 milliseconds
Total sweep time:  0 milliseconds
Total page recovery time:  0 milliseconds
Max Pause Time:  0 milliseconds
Grand total GC time:  0 milliseconds
GC summary:5 MB,2 GC0 ms, Pauses0 ms <0 ms

$ DRT_GCOPT="heapSizeFactor=1.5 profile:1" dmd hello.d
[no output]

Are you sure dmd honours it? I can't grep rt_envvars_enabled in 
the dmd sources.


How can I otherwise get dub to pass these onto dmd?


Re: Tweakig -lowmem to be more eager

2019-05-20 Thread Boris-Barboris via Digitalmars-d-learn

On Sunday, 19 May 2019 at 23:54:27 UTC, Anonymouse wrote:

What makes it decide to collect? What triggers it?


You can try setting heapSizeFactor option to something lower than 
2 to increase collection frequency:

https://github.com/dlang/druntime/blob/47b03c14a1097d28afcf22f645628ba4046377bd/src/core/gc/config.d#L26
https://dlang.org/spec/garbage.html#gc_config

dmd appears to respect DRT_GCOPT environment variable.

The logic behind the decision to collect, I'm afraid, is not 
described anywhere but the code itself 
(https://github.com/dlang/druntime/blob/47b03c14a1097d28afcf22f645628ba4046377bd/src/gc/impl/conservative/gc.d#L1690)


Re: Tweakig -lowmem to be more eager

2019-05-19 Thread Anonymouse via Digitalmars-d-learn

On Sunday, 19 May 2019 at 23:54:27 UTC, Anonymouse wrote:

Tweakig


I'd edit the title if I could. Grumble mutter.