3 ms·
Malloc does not have constant nor guaranteed runtime. It leads to memory fragmentation and requires non constant searches to find a free spot for the next mall
by admax88qqq 4y ago
Malloc does not have constant nor guaranteed runtime.
It leads to memory fragmentation and requires non constant searches to find a free spot for the next malloc.
- pizlonator 4y agoIt’s extremely difficult to make anything in GC have constant time guarantees. Although non real time GCs can defrag the heap, it’s a huge problem to do it in a real time GC.
- admax88qqq 4y agoSane problems as malloc and free. And due to GC being abstracted and faster amortized time per allocation you have more resources to work with. Look at the Metronome GC from IBM You basically have to guarantee a certain level of resources or a certain allocation rate. Things you have to do anyways in non GCd languages. This whole conversation is moot. Hard real time does not mesh with dynamic allocation, unless your allocation behaviour is very well understood and predictable, in which case it ain't hard to design a GC that works for it. Malloc/free are not free. They have their own limitations and performance characteristics.