6 ms·
Many controllers have almost zero memory headroom meaning your GC pauses get an order of magnitude slower if not more as you have less than 2x your working set.
by vvanders 9y ago
Many controllers have almost zero memory headroom meaning your GC pauses get an order of magnitude slower if not more as you have less than 2x your working set.
Also, most of the applications never allocate because they can't even afford the overhead of pooling/freelists that come with a stock malloc implementation.
- abiox 9y agois a gc all that relevant if you're not dynamically allocating in either case?
- vvanders 9y agoGarbage collection by its nature implies dynamic allocation. You're using value types and raw pointers in those targets because even the memory overhead of a heap/freelist/etc can be too much. With things like AVR you're looking at 512B to 16kB of total memory(part of which includes the code you write).
- abiox 9y ago> Garbage collection by its nature implies dynamic allocation i'm not sure i follow - you're saying that a gc existing implies that one cannot preallocate and avoid dynamic allocation?
- vvanders 9y ago> preallocate This will still use dynamic allocation to do the preallocation. You'll have a heap to track this which comes with its own overhead.
- abiox 9y agoi guess i was using 'dynamic allocation' to mean allocation that occurs in the midst of the main control flow, likely in response to some conditional evaluation (vs upfront).
- vvanders 9y agoYeah, if you allocate in the main loop or preallocate you're still going to pay the overhead of a heap to keep track of those allocation :).