2022 Volume 39 Issue 4 Pages 4_97-4_128
This paper presents a novel tool called UCDetector, which detects strong retain cycles and memory leaks that occur due to the limitation of Swift ARC mechanism. We provide a simple and compact implementation of UCDetector by utilizing the facts that Swift is statically-typed and thus safe, but it also allows low-level programming, as well as Swift reflection API and a debugger lldb’s Python API. We also present several findings that there are non-trivial obstacles in the implementation. Finally, we present a result of our preliminary evaluation on the accuracy and efficiency of cycle/leak detections, which show a promising result.