Pattern-based Circular Reference Detection in Python

Jie Chen,Tao Jiang,Dongjin Yu,Haiyang Hu
DOI: https://doi.org/10.1016/j.scico.2023.102932
IF: 1.039
2023-01-01
Science of Computer Programming
Abstract:Circular references keep objects in loops from being released even if they are no longer reachable. Programming languages provide various garbage collection strategies for reclaiming unused objects at runtime. For example, CPython is equipped with a tracing collector as a complement to the count-based collector to recycle circular garbage. However, runtime detection inevitably entails resource consumption. The overhead of circular reference detection can be reduced if the introduction of circular references can be avoided, or if the presence of circular references in code can be detected before the code is run.
What problem does this paper attempt to address?