Tagged articles
Reference Counting
35 articles · Page 1 of 1
This article explains how Java's reachability analysis garbage collection handles circular references, contrasts it with reference counting's failure on cycles, details GC roots, three-color marking, finalize() resurrection, and identifies real memory leak patterns caused by lingering root references.
Circular ReferencesFinalizeGC Roots
0 likes · 15 min read

The article breaks down Python’s memory system layer by layer, explaining stack vs. heap, reference counting, generational garbage collection, the true effect of the del statement, built‑in optimizations like integer caching, string interning and __slots__, and shows how to process a 20 GB CSV efficiently with generators.
PythonReference Counting__slots__
0 likes · 12 min read

KaiFG, Kuaishou's self‑built AI Feature Generator, unifies fragmented feature extraction frameworks, replaces slow C++ compilation cycles with Python‑level development, and achieves near‑C++ performance through Codon‑based compilation, reference‑counted memory management, and aggressive LLVM optimizations, dramatically shortening iteration time.
AI infrastructureHigh-Performance ComputingReference Counting
0 likes · 14 min read

This article explains Java's two primary garbage‑collection techniques—reference counting and reachability analysis—detailing their principles, drawbacks such as circular reference issues, and why modern JVMs favor reachability analysis to safely reclaim memory.
JavaReachability AnalysisReference Counting
0 likes · 4 min read

This article provides a comprehensive analysis of Netty's memory‑leak detection mechanism, covering the design principles, leak‑aware buffers, reference handling, sampling strategies, detection levels, and the internal models that enable accurate identification of unreleased native memory in both pooled and unpooled ByteBuf allocations.
JavaNettyReference Counting
0 likes · 44 min read

QuickJS manages memory using reference counting for each object combined with a cycle‑collector that periodically scans roots, decrements child references, and frees objects whose counts drop to zero, while also supporting traditional reachability‑based garbage‑collection techniques such as mark‑sweep, copying, and generational collection.
AlgorithmC++JavaScript
0 likes · 9 min read

This article examines Netty 4.1.x’s ByteBuf reference‑counting mechanism, explains why reference counting was introduced, traces its original design, shows instruction‑level optimizations, reveals concurrency bugs in version 4.1.17, and details the clever even‑odd redesign that guarantees thread‑safe memory release while preserving high performance.
ByteBufConcurrencyJava
0 likes · 34 min read

This article explains CPython’s list creation via PyList_New, details memory allocation, the role of the free‑list cache, the deallocation process in list_dealloc, and the trashcan mechanism that prevents recursion overflow, illustrating each step with code snippets and concrete examples.
CPythonListReference Counting
0 likes · 12 min read

The article surveys seven common garbage‑collection algorithms—Mark‑Sweep, Reference Counting, Copying, Mark‑Compact, Conservative, Generational, and Incremental/Tri‑color—explaining their principles, strengths, weaknesses, evaluation criteria such as throughput and pause time, and practical optimizations, emphasizing that the best choice depends on specific application needs.
GC algorithmsGenerational GCMark‑Sweep
0 likes · 42 min read

This article explains how PHP’s automatic garbage collector works, detailing reference‑counting, zval structures, handling of scalar and composite types, cycle detection, configuration options, and practical debugging techniques using Xdebug and code samples.
Reference CountingXdebuggarbage collection
0 likes · 13 min read


JD TechJun 26, 2023 · Backend Development
This article details a real‑world Netty long‑connection memory‑leak case, explains how to reproduce the problem, uses Netty's advanced leak detection to pinpoint the faulty ByteBuf usage, and presents three practical remediation strategies to permanently fix the leak.
DebuggingMemory LeakNetty
0 likes · 14 min read


21CTOFeb 1, 2023 · Fundamentals
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

This article explains what constitutes garbage in the Java heap, compares reference‑counting and root‑reachability approaches, demonstrates a reference‑counting example, and reviews the main garbage‑collection algorithms and collectors (Serial, ParNew, Parallel Scavenge, Serial Old, Parallel Old, CMS, G1) used by modern JVMs.
G1GC algorithmsJVM
0 likes · 19 min read

The article explains how CPython implements integers as variable‑length base‑2³⁰ arrays, pre‑allocates the small‑integer range –5 to 256 as singleton objects for performance, and demonstrates the effect of this caching using the id() function and reference‑count analysis.
CPythonInteger cachingReference Counting
0 likes · 5 min read

This article explains Python's automatic garbage collection, covering reference counting, the mark-and-sweep algorithm, generational collection, default thresholds, and when to disable or adjust the collector for performance‑critical code.
Generational GCMark-and-SweepPython
0 likes · 7 min read

This article explains how Python’s automatic garbage collection works, covering reference counting, the problems of cyclic references, the mark‑and‑sweep algorithm, generational collection, default thresholds, and when and how to manually control the collector with code examples.
Generational GCMark‑SweepReference Counting
0 likes · 7 min read

The article presents a high‑efficiency Android bitmap‑reuse strategy that combines the inBitmap API with atomic reference counting and a three‑layer LRU cache (active, LruCache, InBitmapPool), dramatically lowering garbage‑collection pauses and achieving over 80 % reuse on pre‑Android 8 devices.
AndroidBitmapImage Reuse
0 likes · 20 min read

This article explains how Java determines which objects are eligible for garbage collection using reference counting and reachability analysis, describes the main garbage‑collection algorithms such as mark‑sweep, mark‑compact, and mark‑copy, and outlines the generational GC process including MinorGC and survivor spaces.
Generational GCJavaMark‑Sweep
0 likes · 7 min read

This article explains Python's memory management, covering reference counting, its limitations with cyclic references, and how the interpreter supplements it with mark‑sweep and generational garbage‑collection algorithms, complete with code examples and detailed diagrams of the underlying mechanisms.
Generational GCMark‑SweepPython
0 likes · 47 min read

This article explains Python's memory management by exploring how objects are stored, how references and reference counting work, the role of the garbage collector, generational collection, and how reference cycles are detected and reclaimed.
PythonReference Countinggarbage collection
0 likes · 11 min read

This article explains Python's memory management, covering object references, identity via id(), reference counting, caching of small objects, the use of the is operator, handling of reference cycles with objgraph, manual reference deletion, and the generational garbage collection mechanism including thresholds and cycle detection.
Generational GCPythonReference Counting
0 likes · 12 min read

This article explains Python's garbage collection mechanism, covering object management, reference counting, cyclic reference handling, the mark‑and‑sweep algorithm, and generational collection thresholds, with illustrative code examples and detailed explanations of each step.
Generational GCReference Countinggarbage collection
0 likes · 9 min read

This article explains Python’s memory management by exploring how objects and references work, demonstrating reference counting, the role of the id() function, the impact of object caching, and how Python’s garbage collector handles reference cycles through generation-based collection.
PythonReference Countinggarbage collection
0 likes · 12 min read

This article explains PHP's garbage collection mechanism, detailing how reference counting works, the role of zval structures, the identification and reclamation process, and provides source code insights to compare PHP's approach with Java's garbage collection.
PHPReference Countingbackend-development
0 likes · 9 min read

This article explains Java garbage collection by outlining its purpose, the criteria for reclaimable objects through reference counting and reachability analysis, when collection occurs, and the main GC algorithms—including mark‑sweep, copying, mark‑compact, and generational collection—along with common JVM collectors.
GC algorithmsJVMJava
0 likes · 9 min read

Python abstracts memory management through reference counting, handles cyclic references with a generational garbage collector, and employs the weak generational hypothesis to efficiently reclaim objects, as illustrated by code examples demonstrating object creation, deletion, and the behavior of different GC generations.
Generational GCReference Countinggarbage collection
0 likes · 8 min read

This article explains the origins of garbage collection, illustrates common memory‑management pitfalls with C‑style malloc/free examples, introduces reference‑counting fundamentals, shows how cyclic references break the algorithm, and compares programmer‑assisted versus runtime solutions while highlighting their trade‑offs.
Automatic Memory ManagementCyclic ReferencesJava
0 likes · 16 min read

The article explains how Java determines whether an object is alive using two main garbage‑collection algorithms—Reference Counting and Reachability Analysis—detailing their mechanisms, limitations such as circular references, the role of GC Roots, finalization, and method‑area reclamation, with illustrative code examples.
JVMJavaReachability Analysis
0 likes · 6 min read

This article explains the JVM memory model, how the JVM decides whether an object is alive using reference counting and reachability analysis, and describes the main garbage‑collection algorithms—including mark‑sweep, mark‑compact, copying, and generational collection—along with their advantages and drawbacks.
Generational GCJVMReachability Analysis
0 likes · 8 min read

This article explains Java garbage collection in depth, covering its definition, historical origins, reference‑counting and reachability algorithms, GC roots, memory regions such as Eden, Survivor and Old, and the main collection strategies like Mark‑Sweep, Copying, Mark‑Compact and Generational collection.
Generational GCJVMJava
0 likes · 15 min read

This article explains how to propagate request‑level context in a Node.js HTTP service by building a call‑tree with async_hooks, avoiding monkey‑patching, handling lifecycle quirks, preventing memory leaks, and using reference‑counted cleanup to ensure reliable context queries.
BackendContext PropagationMemory Leak
0 likes · 15 min read

This article explains Python's garbage collection mechanisms, demonstrates how reference counting works, shows how to detect and fix memory leaks using the gc module, and illustrates the issue with urllib2 through code examples and visual diagrams.
PythonReference Countinggarbage collection
0 likes · 5 min read


21CTOFeb 23, 2017 · Backend Development
This article explains PHP's core zval structure, how different variable types are stored, and the mechanisms of reference counting, copy‑on‑write, and garbage collection that enable efficient memory management in the Zend engine.
BackendPHPReference Counting
0 likes · 12 min read

This article describes how Baidu's QA team identified and resolved a memory‑leak issue in the Bigpipe Broker backend by analyzing a live process with pmap and GDB, extracting reference‑count problems, and fixing the atomic_add misuse that caused the leak.
C++DebuggingReference Counting
0 likes · 9 min read

This article presents a step‑by‑step case study of locating and fixing a memory‑leak problem in Baidu's Bigpipe Broker backend by analyzing a running leaking process with GDB, pmap, and custom scripts, highlighting the pitfalls of Valgrind and the importance of clear function naming.
C++Reference Countingbackend development
0 likes · 10 min read
