D garbage collector and real-time systems
Guillaume Piolat via Digitalmars-d
digitalmars-d at puremagic.com
Sat Oct 29 03:31:37 PDT 2016
On Wednesday, 28 January 2015 at 08:12:25 UTC, Mike wrote:
> On Wednesday, 28 January 2015 at 06:58:42 UTC, Tom wrote:
>>
>> Or is there now the possibility of disabling the GC altogether,
>> or replacing it with a refcounting 'GC' etc?
>
> You can disable the GC:
> http://dlang.org/phobos/core_memory.html#.GC.disable
>
I think it's important to note that there is three ways to go to
minimize GC impact, by order of increasing difficulty:
1. Minimize allocations andthe size of scanned heap. This allows
to still use the GC which is handy. Stay at this level if you
need only speed.
2. Not enabling the runtime. This forces you to be fully @nogc
but using the GC is a runtime error instead of a link error. Stay
at this level if you need reduced memory consumption.
3. Not link with the runtime, or link with a minimal runtime.
This is the hardest way and yield smaller binary size of all,
along with the speed and reduced memory consumption.
GC avoidance is a spectrum.
More information about the Digitalmars-d
mailing list