Reference Cycle Handling

Cluster focuses on challenges of cyclic references in reference counting memory management, solutions like weak references, cycle detection, and comparisons to garbage collection in languages such as Rust and Java.

📉 Falling 0.5x Programming Languages
1,555
Comments
19
Years Active
5
Top Authors
#3807
Topic ID

Activity Over Time

2008
5
2009
14
2010
35
2011
53
2012
42
2013
56
2014
70
2015
110
2016
97
2017
89
2018
96
2019
97
2020
118
2021
124
2022
168
2023
124
2024
117
2025
133
2026
9

Keywords

AFAIK e.g GC OP JS DAG OK DFS PhantomReference i.e references cycles circular reference object reference counting cycle pointer gc counting

Sample Comments

deepsun Aug 27, 2021 View on HN

How do you deal with cycles in reference counting?

pizlonator Oct 2, 2025 View on HN

Ref counting doesn’t work for cyclic data structures

NobodyNada Oct 2, 2025 View on HN

Sure it does. Make the backreferences weak, or use a library that provides cycle detection (or even full-on tracing GC if you really want).

scawf Nov 7, 2022 View on HN

Circular reference does not leak memory if your using a proper GC

LudwigNagasena Aug 31, 2024 View on HN

But doubly linked lists use cyclic references…

mailslot May 9, 2019 View on HN

It has optional cycle detection, yep. But... you could also just spend a couple of minutes to not have cyclic references.

himujjal Dec 22, 2020 View on HN

Hi. How is cyclic references handled? One of the maintainers said it would be removed and made not possible.Also garbage collection. What are you doing for that? ARC?

cpeterso Jan 11, 2015 View on HN

How does Rust deal with reference cycles?

diarrhea Oct 30, 2023 View on HN

Circular references are not an issue, the GC is more than just reference counting.

whyever Jan 10, 2016 View on HN

I think you can leak memory by having cycles.