+1 vote
in D Programming by
Isn't Garbage Collection Slow And Non-deterministic?

1 Answer

0 votes
by

Yes, but all dynamic memory management is slow and non-deterministic, including malloc/free. If you talk to the people who actually do real time software, they don't use malloc/free precisely because they are not deterministic. They preallocate all data. However, the use of GC instead of malloc enables advanced language constructs (especially, more powerful array syntax), which greatly reduce the number of memory allocations which need to be made. This can mean that GC is actually faster than explict management.

Related questions

0 votes
asked May 6, 2020 in C Sharp by SakshiSharma
0 votes
asked Dec 20, 2019 in Service Discovery by sharadyadav1986
...