21CTO
21CTO
Feb 1, 2023 · Fundamentals

Inside CPython’s Garbage Collector: Ref Counting, Cycle Detection & Generational Tricks

CPython’s garbage collector combines reference counting with a cyclic collector that uses generational strategies, fat pointers, and optimized object structures to efficiently identify and reclaim unreachable objects, handling cycles, weak references, and memory layout details while minimizing overhead.

Generational GCPythonReference Counting
0 likes · 21 min read
Inside CPython’s Garbage Collector: Ref Counting, Cycle Detection & Generational Tricks
JavaEdge
JavaEdge
Aug 17, 2021 · Fundamentals

Detecting Cycles in a Linked List with Fast and Slow Pointers (Java)

This article explains how to determine whether a singly linked list contains a cycle using the fast‑slow pointer technique, derives the mathematical reasoning for locating the cycle entry point, and provides a complete Java implementation that returns the node where the cycle begins or null if none.

algorithmcycle detectionfast slow pointer
0 likes · 4 min read
Detecting Cycles in a Linked List with Fast and Slow Pointers (Java)