5 ms·
As a fairly inexperienced programmer, can someone please explain why everyone is so happy there is no garbage collection going on? Shouldn't that be something
by bobbles 12y ago
As a fairly inexperienced programmer, can someone please explain why everyone is so happy there is no garbage collection going on?
Shouldn't that be something we would want?
(Is it because control over this allows us to do extra things?)
- ludamad 12y agoReference counting has an incremental performance burden because of predictable object freeing, while garbage collection has a periodic pause. On mobile devices you often must worry about response-times; it is a lot more easy to reason 'we need to ease up on such and such at this time', and be sure you solved the problem. Garbage collection pauses can be less straight-forward to tackle.
- gress 12y agoGarbage collection causes problems with memory pressure and pauses. ARC is very little different for the programmer, but suffers less from these problems and is easier to integrate with C language code. No reason for GC.
- aidanhs 12y agoThere's a helpful bit of writing about garbage collection on http://sealedabstract.com/rants/why-mobile-web-apps-are-slow/ http://sealedabstract.com/rants/why-mobile-web-apps-are-slow... It boils down to there being a big performance penalty on garbage collection in memory-constrained environments.
- acqq 12y agoThanks! The linked article is absolutely a must-read for discussing the real limitations.
- wpietri 12y agoWow, that's a great article. I'm currently using mobile web stuff (Ionic, Angular, PhoneGap) to prototype some possible mobile apps. It's convenient, but I've been worrying about the long-range performance issues. This gives me a much more detailed way to think about it. That Apple got rid of garbage collection is especially telling.