Hacker News new | ask | show | jobs
by exoji2e 2035 days ago
"iOS software uses reference counting for memory management, running on silicon optimized to make reference counting as efficient as possible; Android software uses garbage collection for memory management, a technique that requires more RAM to achieve equivalent performance."

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."

4 comments

> It is equivalent of saying

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.

Looks like the comparison is between tracing garbage collection & reference counting, both of which could be said to belong to the broader category of "garbage collection" algorithms. I do agree tho that it's confusing
> Reference counting is typically used in garbage collection

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.

The first section of your wiki link compares ref counting vs tracing GC (Java).