3 ms·
> A GC typically makes memory usage and execution latency non-deterministic, or at the least very hard to analyze. You could say same about malloc and free. No
by vardump 9y ago
> A GC typically makes memory usage and execution latency non-deterministic, or at the least very hard to analyze.
You could say same about malloc and free. Not deterministic at all either. Memory fragmentation is a huge issue as well, and can bring down the whole system.
Typical GC (not all flavors) has a huge advantage on microcontrollers: you gain ability to compact heap. No more fragmentation.
That said, mostly I try not to dynamically allocate anything in firmware or kernel drivers. Whenever possible. Sometimes I write my own specialized allocators. For example a simple wait free allocator fast and rugged enough to call from an interrupt service routine.