4 ms·
Memory fragmentation? And alloc/free aren't free. So now you have to hack together your own memory management scheme and hope it performs well enough in both ar
by thesmallestcat 10y ago
Memory fragmentation? And alloc/free aren't free. So now you have to hack together your own memory management scheme and hope it performs well enough in both areas to be worth the extra effort and lost safety.
- matthewaveryusa 10y agoContemporary allocators make allocation cheap. Not sure how GC is any better at fragmentation.
- mrob 10y agoSome garbage collectors can move objects to remove fragmentation and update the pointers to them. eg: https://hacks.mozilla.org/2015/07/compacting-garbage-collection-in-spidermonkey/ https://hacks.mozilla.org/2015/07/compacting-garbage-collect...
- Impossible 10y agoIf you're thinking like that I don't see why you wouldn't prefer Java or C#? One of the major advantages of C and C++ is explicit memory allocation and lack of GC pauses.
- justin66 10y agoA person could wish for a more compact and lightweight runtime than what Java and .Net offer while still having GC. I imagine some of those people are checking out Go nowadays.
- netheril96 10y agoOracle's JVM have compacting GC that solves memory fragmentation, but Python and Ruby certainly do not. Python and Ruby interpreters also do a lot more dynamic allocations, so if memory fragmentation is ever a problem, they suffer worse.