by exoji2e · 6y ago · 0 comments
This statement is nonsense. Reference counting is typically used in garbage collection. https://en.m.wikipedia.org/wiki/Reference_counting
It is equivalent of saying "On iOS devices the memory efficient Chrome app can be used, but on Android phones a browser is used, which requires more RAM for equivalent performance."
No, they are not equivalent.
It is true that reference counting is a form of GC. However, Java's GC is not based primarily on reference counting. It is much more complex and, generally, does indeed use much more memory.
Swift's reference counting is not much different than C++ shared pointers, except that it is all baked into the language. It is generally true that iOS devices require less memory to achieve the same things as Android devices.
While you _can_ implement a garbage collector with reference counting, and in the broadest possible definition of 'garbage collector' you could call Apple's use of reference counting a garbage collector, no, what people typically call garbage collectors are not, today, typically primarily dependent on reference counting.