Reference Counting vs GC

The cluster centers on debates about whether reference counting constitutes garbage collection, its performance costs like overhead from increments/decrements and handling cycles, and comparisons to tracing GC in languages such as Rust, Swift, and Python.

📉 Falling 0.3x Programming Languages
3,166
Comments
20
Years Active
5
Top Authors
#9396
Topic ID

Activity Over Time

2007
1
2008
5
2009
25
2010
35
2011
112
2012
78
2013
127
2014
179
2015
184
2016
221
2017
165
2018
140
2019
253
2020
288
2021
231
2022
343
2023
326
2024
264
2025
186
2026
3

Keywords

RC AFAIK COW CPU GC GNU RAII NET RefCell API reference counting counting reference gc garbage collection garbage collection memory arc deterministic

Sample Comments

rat9988 Jan 30, 2023 View on HN

reference counting is not necessarily faster.

moonchild Oct 18, 2022 View on HN

Reference counting is much slower than 'garbage collection'.

pkulak May 10, 2025 View on HN

That reference counting is done at runtime. It’s a runtime garbage collector. It’s different than a generational GC, but it’s GC. Those cycles to increment and decrement a counter attached to every object at ever touch aren’t free. All the downvotes in the world won’t make that free.

Ygg2 Aug 4, 2016 View on HN

Reference counting is GC. Simple, but GC.

true_religion Aug 13, 2012 View on HN

Does ref-counting count as garbage collection?

LessDmesg Dec 14, 2019 View on HN

Reference counting is not better, it's a poor man's GC. Reference counting means: 1) instruction pollution from all the refcount updates and their synchronization 2) circular references, ie memory leaks 3) too much time spent freeing memory (whereas a generational GC spends time on live objects only) 4) memory fragmentation and hence slow allocation (whereas in a normal GC allocation is just O(1)

sklogic May 24, 2016 View on HN

Reference counting is never fast. Even on a single core.

Ono-Sendai Feb 29, 2020 View on HN

Why don't you use reference counting GC?

pjmlp Oct 29, 2022 View on HN

Reference counting is hardly modern, and is a GC algorithm.

eridius May 2, 2016 View on HN

Ah so you're defining reference-counting as garbage collection?