This article explains how the JVM determines object liveness, describes reference counting and reachability analysis, lists GC Roots, and provides clear visual and code examples of the main garbage‑collection algorithms—mark‑sweep, copy, mark‑compact, and generational collection—highlighting their advantages, drawbacks, and typical use cases.
This article explains the three‑color marking algorithm used by Java’s CMS and G1 garbage collectors, detailing the color semantics, algorithmic steps, common pitfalls such as floating garbage and miss‑marking, and the specific solutions each collector employs to minimize stop‑the‑world pauses and improve memory reclamation efficiency.
This article provides a comprehensive overview of the Java Virtual Machine, explaining its main purpose, memory regions, class‑loading mechanism, object creation process, memory allocation strategies, object layout, reference handling, garbage‑collection theories, algorithms, and common JVM tuning commands.
This article explains the architecture of the OpenJDK HotSpot JVM, covering bytecode execution, JIT compilation, garbage collection, ergonomic defaults, configuration options, their lifecycle, and practical tuning advice to help developers optimize Java applications for various environments.
This article analyzes the main factors that contribute to Young Generation GC (YGC) latency in the JVM, covering safe‑point pauses, live object scanning and marking, object copying, GC log overhead, and OS activity, and offers practical tips for diagnosing and reducing pause times.
The article reviews benchmark results showing Java 17’s speed gains over earlier releases, outlines upcoming Java 18 features such as the third‑incubated Vector API, preview record and array patterns, UTF‑8 default charset, and JavaDoc snippet support, and points to further reading.
This article explains how Java objects are laid out in memory, compares the heap locations of fields and local variables, analyzes the byte size of a plain new Object() with and without compressed oops, demonstrates measurement using JOL, and reviews related heap regions and garbage‑collection concepts.
The article explains Java 17’s release as the first LTS since Java 11, details Oracle’s new free JDK license, and presents a thorough OptaPlanner benchmark that compares JDK 11, 16, and 17 using G1GC and ParallelGC, revealing performance gains and guiding upgrade decisions.
This article reviews the most important JDK 17 updates to HotSpot’s G1 and Parallel garbage collectors, covering new large‑page support, dynamic reference processing, preventive collection, memory‑saving tweaks, and upcoming JDK 18 enhancements that impact performance and pause times.
This article explains Java 17’s new long‑term‑support release, Oracle’s free JDK licensing, and presents OptaPlanner benchmark results comparing JDK 11, 16 and 17 with G1GC and ParallelGC, highlighting performance gains and migration considerations for developers in production.
This article compiles a series of JVM interview questions covering heap partitioning, garbage‑collection algorithms, collector types, memory coordination, tuning strategies, and practical tooling such as jstat, jmap, and MAT, providing detailed explanations and command‑line examples for each topic.
This article explains how Shenandoah OpenJDK's new concurrent thread‑stack processing, introduced in JDK 17, dramatically reduces garbage‑collection pause times to sub‑millisecond levels by using stack watermarks, and provides practical configuration guidance and benchmark results.
This article provides a comprehensive JavaScript guide covering primitive and reference types, Symbol and BigInt nuances, type‑checking operators, stack vs heap memory, deep and shallow copying techniques, and practical garbage‑collection strategies to help developers ace interview questions.
This article explains how frequent use of Node.js's vm module can cause out‑of‑memory crashes in V8 due to an uncollected compilation cache, the role of the --always‑promote‑young‑mc flag, and practical work‑arounds for Node.js 12, 14 and 16.
This article provides a comprehensive overview of the Java Virtual Machine memory layout, explaining each region such as the heap, metaspace, stack, program counter, direct memory and code cache, along with allocation strategies, tuning parameters, and practical OOM demonstrations.
The article details a full‑link tracing system for Node.js that leverages experimental async_hooks to monitor asynchronous resource lifecycles, builds an invoke‑tree to map parent‑child relationships, implements garbage collection, and provides a ZoneContext API for propagating custom tracing data across async call chains.
This article introduces the most frequently used JVM startup parameters, explains their effects on garbage collection, heap configuration, class loading monitoring, and out‑of‑memory handling, and provides example outputs to help developers tune Java applications for large‑scale projects.
This article explains the Java heap structure, generational layouts in JDK 1.7 and 1.8, the G1 collector's region-based approach, and detailed object allocation rules including Eden placement, large object handling, promotion thresholds, and space allocation guarantees.
The article compares Java’s mature, generational garbage collector—using mark‑copy for young objects, mark‑sweep/compact for old, with sophisticated write barriers and fragmentation handling—to Go’s non‑generational, concurrent tri‑color mark‑sweep collector that relies on a span‑based memory pool, TCMalloc optimizations, and simpler root selection.
The article shares the author’s experience reading the third edition of "Understanding the JVM," focusing on JVM memory management, garbage‑collection algorithms, tuning strategies, and practical tools, while providing concise summaries of each book section and actionable advice for Java performance optimization.
The article details Go’s runtime memory architecture—including pages, spans, mcache, and size classes—and explains its non‑generational concurrent tri‑color mark‑and‑sweep garbage collector, the required write‑barrier techniques, and the collector’s evolution, phases, trigger mechanisms, and practical code examples across Go 1.0‑1.16.
The article explains Java’s automatic memory management, detailing JVM memory regions, object liveness via reachability analysis, allocation strategies, and the main garbage‑collection algorithms—Mark‑Sweep, Mark‑Copy, Mark‑Compact—and compares HotSpot collectors such as Serial, Parallel, CMS and G1, guiding developers to choose the best fit for their workloads.
This article explains what memory leaks are in Java, compares them with C++ leaks, describes the garbage collection mechanism, lists common leak sources such as static collections, listeners, and singletons, and provides practical guidelines and tools to detect and prevent them.
The article provides a comprehensive overview of Java garbage‑collection algorithms, JVM memory regions, object reachability analysis, the semantics of volatile, synchronized and ReentrantLock, thread‑pool creation and operation, deadlock examples, distributed‑lock strategies, and related tooling such as JUC utilities and Git conflict handling.
Over a month of systematic JVM tuning reduced Full GC from 40 times per day to once every ten days and halved Young GC duration by adjusting heap sizes, survivor ratios, and metaspace settings while investigating and fixing a memory leak caused by an anonymous inner class listener.
This article demonstrates how to trigger and interpret JVM garbage‑collection logs by creating a small Java program, configuring heap parameters, and dissecting both young and full GC log entries to reveal causes, memory changes, and performance implications.
This article explains the G1 garbage collector’s architecture, region types, pause‑time prediction model, memory allocation parameters, collection phases, and tuning considerations, providing code examples and practical insights to improve performance for Java developers.
This article details 58.com’s big‑data team’s migration of HBase clusters from CMS/G1 to the low‑latency Z Garbage Collector, explains ZGC’s design and key techniques, presents performance test results versus CMS, discusses tuning parameters, and shares practical lessons from production deployment.
Over a month, we reduced Full GC occurrences on a 2‑core, 4 GB JVM cluster from roughly 40 times per day to once every ten days, while halving Young GC duration, by adjusting heap parameters, fixing memory leaks, and tuning metaspace, ultimately improving server throughput and stability.
Tencent's Kona JDK 11 introduces a production‑ready ZGC implementation that reduces Java garbage‑collection stop‑the‑world pauses to under 10 ms, enabling ultra‑low‑latency online services across massive heaps while maintaining acceptable throughput, and the article details its design, tuning, and real‑world deployments.
This article explains the JVM heap memory area, its default and configurable sizes, the generational layout (Eden, Survivor, Old), how objects are allocated and promoted, and the various garbage‑collection mechanisms and JVM parameters that affect performance and memory usage.
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.
This article provides an overview of the most common Java JVM garbage collectors—including Serial, ParNew, Parallel, Serial Old, CMS, Parallel Old, and G1—detailing their characteristics, advantages, disadvantages, typical usage scenarios, and JVM tuning parameters for optimal performance.
Over a month of JVM tuning, the author reduced Full GC from more than 40 times per day to once every ten days and halved Young GC duration by adjusting heap sizes, fixing memory leaks, and tuning metaspace, ultimately improving server throughput and stability.
This article explains how ThreadLocal works in Java, demonstrates how improper use can cause Out‑Of‑Memory errors, analyzes the underlying cause in ThreadLocalMap, and provides a simple fix by invoking remove() after use to avoid memory leaks.
This guide compiles all JVM garbage‑collection parameters—standard, non‑standard, and experimental—explaining their meanings and how to configure them to minimize pause times, improve performance, and tailor GC behavior for different application types and hardware environments.
Over a month of systematic investigation, the author reduced Full GC occurrences on a 2‑core, 4 GB Java server cluster from 40 times a day to roughly once every ten days by adjusting heap settings, fixing a memory‑leak caused by an anonymous listener, and tuning Metaspace and CMS thresholds, ultimately achieving stable performance and lower latency.
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.
This article provides a comprehensive guide to JVM performance tuning, covering the JVM architecture, runtime data areas, various garbage collectors, configuration flags for heap and GC settings, and practical recommendations for selecting the optimal GC strategy based on workload characteristics.
This article uses a real‑world recommendation system case to explain how Java objects are created in the young generation, survive multiple young GCs, and are promoted to the old generation under various conditions such as repeated GC cycles, dynamic age thresholds, and space‑guarantee mechanisms.
Understanding JVM garbage collection with the CMS collector involves grasping class‑loader hierarchies, memory regions such as Young, Old and Metaspace, the multithreaded ParNew young collector, CMS’s four‑phase mark‑sweep‑compact cycle, and applying tuning parameters—like survivor ratios, tenuring thresholds, and concurrent marking options—to minimize stop‑the‑world pauses and full GCs on typical 4‑core, 8 GB servers.
This article explains V8's internal object representation, pointer tagging, the three property storage modes (inobject, fast, slow), how constructors and literals allocate space, the rules that trigger mode switches, and the slack‑tracking technique that refines memory usage.
This article explains the misconception that null‑assigning unused objects always improves Java garbage collection, demonstrates with concrete JVM examples how stack references affect object reachability, and shows how explicit null or variable reuse can free memory more effectively.
This article documents a month-long JVM garbage‑collection tuning effort on a 2‑core, 4 GB server cluster, detailing initial problems with frequent FullGC, successive configuration adjustments, memory‑leak investigations, and the final optimizations that cut FullGC occurrences and significantly improved overall throughput.
This article explains Apache Pulsar’s message storage architecture in BookKeeper, details the ledger and entry lifecycle, describes the multi‑layer caching read path, and outlines BookKeeper’s garbage‑collection process along with practical operational tips for avoiding disk‑heavy scenarios.
This article provides an in‑depth overview of the Java Virtual Machine, covering JDK/JRE/JVM relationships, compilation process, class loading mechanisms, the parent‑delegation model, runtime memory areas, garbage collection algorithms and collectors, and practical JVM performance tuning tips for backend developers.
This article examines how Oracle's G1 garbage collector, the default since JDK 9, outperforms the traditional CMS collector in multi‑core, large‑memory environments through parallelism, space integration, predictive pause models, and real‑world performance testing on Yuewen's licensing service.
This article explains the evolution of garbage collection, why G1GC is chosen for low‑latency high‑availability Java services, how it achieves soft real‑time guarantees, the internal heap and region structures, concurrent marking, SATB, remembered sets, and the algorithms used to predict pause times.
This article explains JavaScript memory leaks, covering their definition, how JS manages stack and heap memory, automatic garbage collection, Chrome DevTools profiling techniques, and common leak patterns such as improper closures, global variables, detached DOM nodes, console logging, and forgotten timers, with detection and mitigation strategies.
This article explains the Java 8 memory architecture, detailing the differences between JVM-managed memory and native memory, describing each runtime data area such as the program counter, JVM stack, native method stack, heap, method area, and direct memory, and answering common questions about variable storage, native methods, literals and symbolic references.
This article explains the core components of the Java Virtual Machine, including its memory regions, class loading process, object allocation strategies, garbage‑collection algorithms, and tuning tools, providing a comprehensive guide for developers to optimize Java applications.
This article explores how the JVM updates object references during garbage collection, compares handle‑based and direct‑pointer implementations, demonstrates why the default toString output shows a hashcode rather than a real address, and shows how to obtain the actual memory address using the JOL library.
This article explains why reading the ART virtual‑machine source is valuable, compares Dalvik and ART, outlines the GC source hierarchy, details the Space class architecture—including accounting, allocator, collector, and specific spaces like LargeObjectSpace, BumpPointerSpace, and RegionSpace—then analyzes heap construction, PreZygoteFork processing, memory‑map layout, and the full Java‑object allocation flow in ART.
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.
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.
The article explains ZGC, Oracle's low‑latency Java garbage collector introduced in JDK 11, covering its dynamic region layout, colored pointer technique, tri‑color marking, memory multi‑mapping, read barriers, operation phases, performance characteristics, and its main drawback of floating garbage.
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.
This article examines the challenges of GC pauses in low‑latency HBase services, explains ZGC’s fully concurrent architecture and key techniques such as colored pointers and read barriers, and presents experimental comparisons of ZGC and G1 GC using YCSB benchmarks, highlighting latency, throughput and CPU usage differences.
Understanding how JavaScript manages memory, this article explains garbage collection concepts such as Stop‑The‑World pauses, reference counting, mark‑sweep, mark‑compact, incremental marking, and V8’s generational strategies, while offering practical code examples and optimization techniques to prevent leaks and improve performance.
This article presents a systematic experiment that compares four different IntelliJ IDEA memory configurations on a MacBook Pro, measuring IDE startup time, project loading speed, and JVM garbage‑collection metrics with jstat to identify the most efficient setup for large Java monoliths and micro‑service projects.
This article uses the Chinese Spring Festival story to explain Java's heap structure, young and old generations, large‑object allocation, and how excessive memory consumption leads to heap‑space OOM and stop‑the‑world garbage collection, providing code examples and practical mitigation tips.
This article explains the typical sources of Java OutOfMemoryError—including static collections, unclosed connections, improper variable scopes, inner‑class references, hash value changes, cache misuse, and lingering listeners—and provides code examples and solutions to prevent memory leaks.
Even though many joke that simply increasing JVM heap solves performance issues, this article explains why blind memory expansion often worsens latency in high‑concurrency scenarios and presents concrete tuning strategies such as adjusting young generation size, reducing stack memory, and monitoring GC metrics.
This article compiles essential JVM interview topics, covering ClassLoader mechanisms, Java memory layout, garbage collection concepts and algorithms, as well as practical performance tuning techniques, providing links to detailed resources and common interview questions for each area.
This comprehensive guide walks through the Java Virtual Machine's runtime data areas, memory model, heap layout, garbage‑collection mechanisms, HotSpot internals, performance tuning flags, and class‑loading process, providing developers with the essential knowledge to optimize Java applications.
This comprehensive guide explains the JVM memory layout, object allocation, garbage collection mechanisms such as mark‑sweep, copying, and mark‑compact, details GC roots, reference types, collector types, tuning parameters, and related Java performance tools, providing practical code examples and diagrams.
In 2020 Tencent's KonaJDK team enhanced Java memory analysis by parallelizing jmap heap scans across multiple garbage collectors, achieving 2‑8× speedups, adding gzipped heap dump support, and contributing dozens of patches and commits to the OpenJDK community.
This article explains the different types of Java garbage collectors, focuses on the G1 (Garbage‑First) collector’s region‑based architecture, key data structures and algorithms such as TLAB, PLAB, CSet, Card Table, RSet, and SATB, and provides detailed log analysis and tuning recommendations to improve pause times and throughput.
This comprehensive guide explores Java's JVM internals, covering memory leaks, data type sizes, differences between Serial and Parallel GC, reference types, compressed OOPs, JVM bitness detection, heap limits, JRE/JDK/JVM/JIT distinctions, memory regions, garbage collection algorithms, class loading mechanisms, and practical tuning commands and tools, providing developers with deep insights into Java performance and memory management.
This article provides a step‑by‑step guide for diagnosing Java production issues by systematically checking CPU usage, disk health, memory consumption, garbage‑collection behavior, and network problems using common Linux tools and JVM utilities such as ps, top, jstack, jstat, vmstat, iostat, free, jmap, and tcpdump.
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.
This article provides a comprehensive overview of the Java Virtual Machine, covering its runtime data areas, the Java Memory Model, heap organization, garbage‑collection algorithms, HotSpot implementation details, JVM tuning parameters, and the class‑loading mechanism.
This article explains the architecture of browser engines, the distinction between stack and heap memory, V8's generational garbage collection strategies—including the Scavenge algorithm for the young generation and mark‑sweep/mark‑compact for the old generation—along with optimizations such as write barriers, incremental marking, and parallel/concurrent collection.
This article demystifies the common advice of assigning null to unused objects by showing how Java's runtime stack and reachability analysis affect garbage collection, using concrete code examples, GC logs, and stack‑slot reuse to explain when null‑assignment actually helps reclaim memory.
This article examines the evolution of Java garbage collectors, detailing the design and operation of G1, ZGC, and Shenandoah, and explains key concepts such as generational collection, write and read barriers, SATB, RSet, and multi‑view mapping with illustrative code and diagrams.
This article examines the evolution and classification of HotSpot JVM garbage collectors, explaining the performance triangle of heap usage, throughput and pause time, and detailing generational, region‑based, and low‑latency collectors such as G1, Shenandoah, and ZGC with their design principles and benchmark results.
This guide explains Java HotSpot CMS garbage collection fundamentals, common problem scenarios like space shock and premature promotion, systematic root‑cause analysis using logs and tools, and practical optimization tactics such as stabilizing heap size, tuning CMS flags, monitoring off‑heap memory, and migrating to newer collectors.
This article provides a comprehensive overview of Google’s V8 JavaScript engine, covering its architecture, compilation process, bytecode, hidden classes, inline caches, garbage collection, and debugging tools such as d8, with practical code examples and performance optimization tips for developers.
The article explains how a high‑frequency trading firm evaluated Java versus C++ for ultra‑low‑latency trading, discusses the challenges of JVM JIT compilation and garbage‑collection pauses, and shows how Azul Zing’s C4 collector delivers near‑C++ latency while preserving Java’s development productivity.
This article explores the underlying principles of Java Virtual Machine garbage collection, detailing core concepts, classic algorithms, generational and incremental improvements, and the role of read/write barriers, helping developers grasp why mastering GC is a fundamental skill for high‑performance Java programming.
This article explains Java's four reference types—strong, soft, weak, and phantom—detailing their purposes, behavior during garbage collection, and practical code examples that demonstrate how each reference influences object lifecycle and memory management.
The article outlines eight official JDK 16 proposals—including ZGC thread‑stack removal, flexible metaspace, C++14 support, incubator vector API, Windows/AArch64 ports, Alpine Linux builds, and the migration of the OpenJDK source from Mercurial to GitHub—while noting JDK 16’s short‑term support and the prevalence of JDK 8 among developers.
This article revisits memory allocation and reclamation concepts by examining Java's Netty memory pool implementation, its theoretical basis in jemalloc, and practical design choices such as arena allocation, thread‑local caches, pool chunks, sub‑pages, and multi‑threaded performance considerations.
This article provides a comprehensive overview of the Java Virtual Machine memory layout, explaining the roles and allocation strategies of the heap, metaspace, stack frames, program counter, direct memory, and code cache, and includes practical code examples for heap tuning and OOM demonstration.
By tracking the discrepancy between the number of EngineLayer objects actually rendered each frame and the total EngineLayer instances retained in native memory, developers can detect and pinpoint Flutter memory leaks caused by lingering Dart references, using SceneBuilder monitoring and WeakPersistentHandle inspection.
This article explains the definitions of JVM -Xms and -Xmx, how heap memory grows and shrinks, the impact on garbage collection, and why configuring both parameters to the same value can improve performance and stability in production environments while noting potential drawbacks.
This article investigates native memory out‑of‑memory crashes on certain Android devices caused by excessive CameraMetadata allocations, explains how delayed finalization and GC timing exacerbate the issue, and proposes proactive memory release and GC triggering techniques that dramatically reduce crash rates.
The article explains how using an element's string representation as a cache key caused duplicate extraction in a Python news‑page parser, reveals the role of Python's garbage collection and memory reuse, and shows how switching to XPath keys resolves the bug.
This article examines the Z Garbage Collector (ZGC) introduced in JDK 11, detailing its low‑pause design goals, underlying concurrent marking‑copy algorithm, colored pointer and read‑barrier techniques, practical tuning parameters, real‑world case studies, and the performance impact of upgrading from CMS/G1 to ZGC in high‑throughput, low‑latency services.
This article presents a comprehensive collection of JVM interview questions covering memory areas, garbage collection, class loading, and performance tuning, along with eleven detailed Java mind‑map images that visually summarize core concepts such as the JVM architecture, GC algorithms, and thread management.
The article explains how Meituan’s risk‑control platform eliminated frequent 40 ms CMS pauses by adopting JDK 11’s ZGC—detailing its concurrent mark‑copy design, practical tuning parameters, real‑world case fixes, and measured latency reductions of up to 74 % while noting trade‑offs.
This article details Ctrip's practical design and implementation of a bidirectional Redis synchronization system across data centers, covering replication loop breaking, conflict resolution with Last Write Wins and Vector Clocks, tombstone handling, garbage collection strategies, and expiration policies to ensure data consistency.
The article anthropomorphizes several JVM internal threads—FinalizerThread, AppClassLoader, ReferenceHandler, and VMThread—detailing how they handle object finalization, class loading, special reference queues, and VM operations, providing a whimsical yet informative overview of JVM internals.
This article explains a puzzling bug in the General News Extractor where cached HTML elements produce inconsistent results, analyzes how Python's garbage collection and memory reuse cause duplicate text extraction, and shows how switching the cache key to XPath resolves the issue.
The article outlines seven essential performance metrics—response time and throughput, average load, error rate, GC pause time, business indicators, uptime, and log size—explaining their significance for application health and recommending popular monitoring tools for each metric.
This article provides a comprehensive overview of the Java Virtual Machine's runtime data areas—including the program counter, JVM stack, native method stack, heap, and method area—explaining their structures, lifecycles, related JVM flags, garbage‑collection strategies, TLAB, and escape‑analysis optimizations.
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.
This article presents a comprehensive overview of JDK8's garbage collection mechanisms, detailing memory regions, available collectors, key tuning parameters, thread settings, and practical commands, complemented by eight illustrative diagrams and a downloadable PDF cheat sheet for quick reference.