The article explains the purpose of Survivor spaces in the JVM young generation, how they reduce premature promotion to the old generation, prevent fragmentation, and improve garbage‑collection efficiency by using two alternating survivor areas.
This article explains the differences between Java's heap and stack memory areas, their advantages and disadvantages, and demonstrates how string objects are allocated and shared with clear code examples that illustrate memory usage and performance implications.
This article explains Java HotSpot VM garbage‑collection ergonomics, detailing pause‑time and throughput goals, generational collection mechanics, default heap sizing, and how to select and tune Serial, Parallel, G1, and ZGC collectors for optimal performance.
This article explains the distinction between Java memory regions and the Java Memory Model, describes each JVM runtime data area—including the program counter, stacks, heap, metaspace, and direct memory—and outlines how the model governs visibility, ordering, and synchronization in concurrent programs.
This article provides a comprehensive overview of the Java Virtual Machine (JVM) architecture, detailing its garbage collection mechanisms, class‑loader subsystem, execution engine, runtime data areas, and common GC command‑line options, offering essential knowledge for Java developers.
This article explains the four kinds of Java references—strong, soft, weak, and phantom—how they interact with the garbage collector, the role of ReferenceQueue, and provides practical code examples and JVM internal details to help developers manage object lifecycles effectively.
This article explains how CPython implements its own memory‑management scheme—including the layered allocation model, pool and arena structures, block size classes, and reference‑count‑based reclamation—by dissecting the source code of Python 2.7’s obmalloc module.
This article explains the JVM's memory layout, including method area, heap, stack, PC register, and native method stack, and details garbage collection concepts such as marking, deletion, compaction, generational GC, and the characteristics of various collectors like Serial, Parallel, CMS, and G1.
This article explains the design goals, architecture, key features, tuning options, and version history of Java's Z Garbage Collector (ZGC), highlighting its sub‑10 ms pause times for terabyte‑scale heaps, its use of colored pointers and load barriers, and the trade‑offs in throughput and configuration.
This article explains, with concrete Java examples and JVM runtime‑stack analysis, why manually assigning null to objects that are out of scope does not always trigger earlier garbage collection, and how stack slot reuse can achieve the same effect without relying on a questionable practice.
This article explains why explicitly assigning null to objects that are no longer used can help Java's garbage collector reclaim memory, explores JVM stack slot behavior, demonstrates the effect with code examples, and clarifies common misconceptions about this practice.
This article provides an in‑depth analysis of Java’s ThreadLocal mechanism, covering its weak‑reference key, internal ThreadLocalMap structure, hash algorithm, collision resolution, cleanup strategies, expansion logic, source code walkthroughs, and practical usage scenarios such as trace‑ID propagation in distributed systems.
This article provides an extensive overview of Java Virtual Machine fundamentals for interview preparation, covering JVM components, runtime data areas, heap vs. stack memory, garbage collection mechanisms, algorithms, collectors, memory allocation strategies, class loading processes, and tuning tools.
This article provides an in‑depth overview of Go's garbage collector, covering its design principles, mark‑sweep algorithm, tri‑color abstraction, write‑barrier techniques, incremental and concurrent collection, evolution across Go versions, and detailed implementation details of marking, sweeping, and memory reclamation.
This article examines production JVM memory architecture, explains GC log generation and analysis, details the ParNew + CMS collector behavior, and provides practical parameter tuning recommendations to optimize heap size, young generation, and garbage collection for stable Java applications in production environments.
Learn how to optimize Java applications by configuring six critical JVM parameters—including heap size, Metaspace limits, GC algorithm selection, logging, heap dumps, thread stack size, and network timeouts—while understanding their impact on performance, memory usage, and troubleshooting common out‑of‑memory issues.
This guide compares the major HotSpot JVM garbage collectors—including Serial, ParNew, Parallel Scavenge, Parallel Old, CMS, G1, and ZGC—explaining their algorithms, threading models, typical use cases, key JVM flags, performance trade‑offs, and how to select the most suitable collector for different application workloads.
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.
This article provides a detailed explanation of the Java Virtual Machine's runtime memory regions, the Java Memory Model, garbage collection mechanisms, heap layout, HotSpot VM internals, class loading process, and performance tuning parameters, offering a solid foundation for Java developers and architects.
On March 17, JDK 14 was officially released, bringing 16 new JEPs—including pattern‑matching for instanceof, a new packaging tool, enhanced G1 memory allocation, JFR event streaming, helpful NullPointerExceptions, records, switch expressions, ZGC on macOS/Windows, and a second preview of Text Blocks—significantly expanding Java’s core capabilities.
This article explains the JVM's object liveness determination methods, covering reference counting and reachability analysis, the four Java reference types, and how finalize() can (but should not) rescue objects, illustrated with code examples and memory‑usage results.
This article explains how to optimize HBase performance by properly configuring JVM memory, selecting suitable garbage‑collection strategies, enabling MSLAB and BucketCache, and adjusting read/write cache ratios to reduce fragmentation and improve throughput.
This article provides a comprehensive overview of Java's automatic garbage collection, covering memory regions, identification methods, core algorithms such as mark‑sweep, copying, and generational collection, detailed explanations of various collectors (Serial, CMS, G1, etc.), and practical tuning insights for optimal performance.
This article explains Java's four reference types, focusing on the implementation and lifecycle of SoftReference, WeakReference, and PhantomReference, and clarifies how garbage collection policies, native and Java layers, and reference queues determine when these references are cleared or notified.
This article outlines the five major preview features slated for Java 14, including instanceof pattern matching, text blocks with new escape sequences, record types, the incubating jpackage tool, and the deprecation of the ParallelScavenge + SerialOld garbage collector combination.
This article explains why the CMS garbage collector was removed in JDK 9, shows the deprecation warning, and evaluates three migration paths—switching to G1 GC, adopting ZGC, or continuing with CMS—helping developers choose the best option for their applications.
This article examines the common advice of assigning null to unused objects in Java, demonstrates through concrete code examples how the JVM's runtime stack and reachability analysis affect garbage collection, and explains why explicit null assignments or slot reuse can make a difference.
F2FS is a log‑structured, flash‑aware file system that transforms random writes into sequential ones, uses segment‑based layout, NAT indexing, and hot‑cold data segregation with sophisticated garbage‑collection to improve SSD performance, and is now deployed in Android devices with ongoing enhancements such as online resizing and cold‑data compression.
This article provides a comprehensive overview of the Java Virtual Machine memory layout, covering heap regions, Metaspace, stack frames, native method stack, program counter, direct memory, and code cache, along with configuration tips, diagnostic commands, and illustrative code examples to help readers understand memory allocation and garbage collection.
This article explains IBM WebSphere Application Server's memory architecture, common causes of Java OutOfMemoryError in WAS, and provides a step‑by‑step guide—including log collection, heap analysis, and preventive measures—to diagnose, resolve, and avoid memory overflow incidents in production environments.
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.
This article explains how Java memory leaks can occur despite automatic garbage collection, describes JVM GC‑Root analysis, outlines practical monitoring with Spring Boot Actuator, Prometheus, and Grafana, and provides step‑by‑step debugging commands and code adjustments to locate and fix the leak.
This article explains how Java memory leaks can occur despite automatic garbage collection, describes JVM reachability analysis, shows how to monitor and detect leaks using Spring Boot Actuator, Prometheus, and Grafana, and provides step‑by‑step instructions for heap dump analysis and code fixes.
This article provides a comprehensive overview of the G1 (Garbage First) collector, covering its region-based memory layout, cross‑generation reference handling, SATB write barriers, various GC phases (Young, Mixed, Full), and how to interpret detailed G1 GC logs for performance tuning.
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.
Discover why Java applications suddenly freeze due to full garbage collection, explore common GC triggers and memory‑leak scenarios, and learn practical strategies—such as eliminating leaks, applying concurrency limits, adaptive rate‑limiting, and traffic monitoring—to keep your backend services stable.
This article explains the fundamentals of the CMS (Concurrent Mark Sweep) garbage collector, presents a comprehensive set of JVM parameters optimized for HBase clusters, and provides detailed analysis of key settings to improve performance and reduce GC pauses.
This article explains the fundamentals of JVM garbage collection, its generational algorithms and associated performance issues, and then details Apache Flink's memory management architecture, including MemorySegment, off‑heap buffers, serialization mechanisms, and type information for efficient big‑data processing.
This article explains the JVM memory layout, how objects are reclaimed through reference counting and GC roots, compares major garbage‑collection algorithms, describes when objects are promoted to the old generation, and provides practical tuning tips to minimize Full GC pauses.
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.
This article explains Java garbage collection fundamentals, detailing JVM memory layout, key -X and -XX parameters, the mechanisms of object survival, and the main GC algorithms—Mark‑Sweep, Copying, Mark‑Compact, and generational collection—providing clear diagrams and interview‑ready insights.
This article explains the Java Virtual Machine’s memory layout, covering the five runtime regions—heap, method area, JVM stacks, native method stacks, and program counter—along with their purposes, thread‑visibility, garbage‑collection behavior, and common pitfalls such as OutOfMemoryError and StackOverflowError.
This article provides a comprehensive overview of the JVM memory model, garbage collection algorithms, various collectors and their trade‑offs, class loading steps, object lifecycle, escape analysis, and practical tuning commands for optimizing Java applications.
This guide explains how to configure JVM options to capture GC logs, use GCViewer to interpret Parallel, G1, and CMS collector logs, decode each log field, and apply concrete tuning parameters to improve pause times and overall application throughput.
This article explains the seven Java garbage collectors available up to JDK 1.8, compares their strengths and weaknesses, and shows how to select and tune the appropriate collector—Serial, Parallel, CMS, or G1—based on application characteristics and deployment environments.
This article explains how the JVM memory layout evolved from Java 7 to Java 8, detailing the shift from the permanent generation to Metaspace, the underlying spec versus HotSpot implementation, and the key JVM flags that control class metadata allocation.
This article provides a comprehensive introduction to the Java Virtual Machine’s memory architecture, detailing the five runtime areas—Program Counter, JVM Stack, Native Method Stack, Heap, and Method Area—their thread scope, memory allocation, garbage‑collection behavior, and common errors such as OutOfMemoryError and StackOverflowError.
This article shares practical experience tuning Java's G1GC, including required JVM flags, key parameters such as G1NewSizePercent and InitiatingHeapOccupancyPercent, an automated script for systematic parameter adjustment, and tools for log analysis to achieve optimal garbage‑collection performance.
This article explains Go's garbage collection mechanism, describing its Mark‑Sweep model, the three collection phases, latency implications, and practical tips for reducing pause times through memory‑pressure reduction and runtime debugging tools.
Over three years, Meitu’s long‑connection service “bifrost,” built in Go with MQTT, cut memory use from 22.3 GB to 5.1 GB for 210 k connections—and about 10 GB for a million—by tuning buffers, reducing allocations, employing memory pools, and replacing a goroutine‑per‑connection model with an epoll‑driven event architecture.
This article provides a comprehensive overview of the JVM runtime memory areas, explains how the JVM determines garbage objects, reviews major GC algorithms and collectors—including the latest ZGC—and offers practical code examples and command‑line instructions for reproducing various OutOfMemoryError scenarios.
Java’s garbage collection, a critical yet often overlooked feature, encompasses various algorithms such as reference counting, reachability analysis, mark‑sweep, copying, and generational collection, each with distinct mechanisms, trade‑offs, and impacts on memory regions like Eden, Survivor, and Old spaces.
This article provides a comprehensive analysis of Go’s non‑generational concurrent mark‑and‑sweep garbage collector, tracing its evolution from early stop‑the‑world implementations to the mixed write‑barrier design in Go 1.8, and explains how to interpret GC traces, tune GC parameters, and reduce latency caused by mark‑assist and STW pauses.
This article explains how Java's automatic garbage collection works, covering the mark‑sweep‑compact phases, the need for generational collection, the structure of the JVM heap (young, old, and permanent generations), and the detailed object promotion process illustrated with diagrams.
This article explains the G1 (Garbage‑First) garbage collector introduced in JDK7, its region‑based architecture, key differences from CMS, and the complete GC cycle—including Young GC, concurrent phases, mixed GC, and Full GC—while providing real‑world log examples and performance insights for Java developers.
This article provides a comprehensive overview of core Java concepts for interview preparation, covering object‑oriented programming fundamentals, differences between OOP and procedural programming, detailed explanations of JVM, JDK, JRE, comparisons with C++, string handling, constructors, inheritance, polymorphism, threading, garbage collection, and related code examples.
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.
This article explains how Node.js relies on the V8 engine for automatic memory management, details the garbage‑collection mechanisms (Scavenge, Mark‑Sweep, Mark‑Compact), shows practical code for monitoring and forcing GC, illustrates common memory‑leak patterns, and recommends tools for diagnosing and fixing leaks.
This article introduces Java classes as object factories, demonstrates how to define and instantiate classes with fields and methods, explains the JVM architecture and memory areas, and explores garbage collection algorithms, providing code examples and conceptual analogies for beginners.
This article explains the design principles, region-based architecture, object allocation strategies, Young and Mixed G1 GC phases, concurrent marking, three‑color marking, and practical tuning parameters for the G1 garbage collector in Java, illustrating concepts with code snippets and diagrams.
This article presents a comprehensive guide to Java application performance optimization, covering OS‑level and JVM‑level diagnostics, profiling tools, GC analysis, JVM tuning, application‑code refactoring, and database‑layer adjustments, illustrated with real‑world case studies and code examples.
This article examines the pause behavior of various OpenJDK garbage collectors by running a memory‑allocation benchmark, presenting detailed GC logs for G1, Parallel, CMS, Shenandoah, and Epsilon, and drawing conclusions on how to choose the appropriate collector for a given workload.
This comprehensive guide explains the JVM memory areas, the fundamentals of garbage collection, generational heap management, various GC algorithms, and practical tuning parameters for Java applications.
This article provides a comprehensive overview of the Java Virtual Machine, detailing its main components, runtime data areas, class loading mechanism, garbage collection algorithms and collectors, heap vs stack differences, object reclamation criteria, and common JVM tuning tools and parameters.
The article explains why a Java‑based backend experiences higher CPU usage, reduced thread count, and frequent Young GC when traffic spikes, detailing the impact of Tomcat thread limits, JVM garbage‑collection pauses, and memory reclamation on overall service performance.
This article explains the evolution of JVM garbage collectors from Serial to G1, details the different collector types, describes G1's memory model and collection phases, and outlines scenarios where G1 provides low‑latency, high‑throughput garbage collection for large Java applications.
By drawing analogies between casino gambling and SSD garbage collection, the article uses probability theory, Brownian motion, and stochastic processes to model victim block selection, resource depletion, and I/O bandwidth fluctuations, proposing control strategies that balance performance stability and resource safety.
ZGC is a scalable, low‑latency Java garbage collector designed to keep pause times under 10 ms regardless of heap size, supporting up to 4 TB, and leveraging concurrent, region‑based, compacting, NUMA‑aware techniques, colored pointers, and load barriers, with detailed compilation and tuning guidance.
This tutorial explains what Java memory leaks are, how they occur through static fields, unclosed resources, improper equals/hashCode, inner classes, finalizers, String interning, and ThreadLocal usage, and provides practical detection methods, profiling tools, and concrete prevention strategies to keep applications performant.
This article explores how JVM memory is allocated, why objects created in methods are not reclaimed instantly, and demonstrates through experiments how Eden space, YGC, and GC behavior affect object lifetimes and overall heap utilization.
This comprehensive guide explains the purpose, lifecycle, trade‑offs, common issues, and performance‑tuning strategies of Java's Concurrent Mark‑Sweep (CMS) garbage collector, helping developers understand when it runs and how to configure it for low‑latency applications.
This article explains the origins, design goals, and detailed mechanisms of Java's G1 garbage collector—including regions, CSet, RSet, SATB, the full collection cycle, common pitfalls, and practical tuning recommendations—to help developers achieve predictable pause times and high throughput.
This article explains the differences between Java heap and stack memory, their advantages and disadvantages, and demonstrates how string objects are stored and shared using code examples that illustrate memory allocation and reference behavior.
This article investigates why objects allocated in a Java method are not immediately reclaimed after the method exits, demonstrating through experiments how JVM heap regions, especially the Eden space, influence garbage collection timing, and provides practical steps to control memory and CPU usage by deliberately allocating small and large objects.
This article clarifies the often‑confusing terminology of Minor, Major, and Full garbage collection in the JVM, explains how each type of GC works, analyzes real GC logs with code examples, and advises monitoring latency or throughput rather than relying on those labels.
This tutorial explains what Java memory leaks are, why they occur, and how to identify them at runtime, covering common leak sources such as static fields, unclosed resources, faulty equals/hashCode implementations, inner classes, finalize methods, string interning, and ThreadLocal misuse, plus practical prevention techniques and profiling tools.
NVMe SSD performance can be unpredictable, so this article opens the SSD "black box" to examine hardware, firmware, and workload factors—such as NAND type, multi‑queue design, garbage collection, and I/O patterns—and offers software‑level strategies to maximize flash efficiency in modern data‑center storage systems.
This article explains the JVM memory architecture—including heap, method area, stack, native stack, and program counter—details how each region is organized, and provides common JVM command‑line options and typical configuration examples for optimizing Java applications.
This article outlines the Java Community Process’s shift to a six‑month release cadence, explains the Release Candidate stage, and details JDK 11’s most notable enhancements—including ZGC, Epsilon, var extensions, removal of Java EE/CORBA modules, and a revamped HTTP client—providing developers with a concise overview of the new runtime capabilities.
The article outlines the scheduled Java 11 release, detailing four major JEP proposals—including local‑variable syntax for lambda parameters, the low‑overhead Epsilon garbage collector, dynamic class‑file constants, and removal of Java EE/CORBA modules—while also discussing the shift to a faster release cycle and long‑term support model.
This article explains how PHP stores variables using the zval structure, manages memory with reference counting and copy‑on‑write, implements a garbage‑collector based on color marking, and allocates memory through a custom heap that handles small, large, and huge allocations.
This article provides a comprehensive overview of the Java Virtual Machine, covering its cross‑platform nature, core components, class‑loader mechanisms, memory layout, object creation steps, various garbage‑collection algorithms and collectors, as well as common interview questions and answers.
This article walks through the G1 garbage collector’s heap structure, region‑based allocation, young‑generation collection steps, and the detailed phases of old‑generation collection, providing clear diagrams and practical insights for Java developers.
This article explains how Java's `new` keyword allocates objects on the heap, how object references reside on the stack, the relationship between references and objects, the mechanics of reference assignment, garbage collection conditions, and why Java uses value‑passing for method parameters.
This article provides a comprehensive overview of the Java Virtual Machine, covering its role in Java's cross‑platform execution, internal architecture including class loaders, runtime data areas, execution engine, memory management, and generational garbage collection mechanisms.
This article reviews Java 10’s major enhancements—including local‑variable type inference, time‑based release cadence, new garbage‑collector interfaces, parallel G1 GC, heap‑allocation on alternative memory devices, repository consolidation, default root certificates, experimental Graal JIT, ThreadLocal handshakes, and removal of the javah tool—highlighting their impact for developers.
This article explains the purpose of Survivor spaces in the JVM young generation, why a single Survivor area is insufficient, how having two Survivor spaces prevents memory fragmentation, and the copy algorithm that keeps one space empty while the other holds contiguous live objects.
Java memory managementSurvivor Spacebackend development
This article explains Java's four reference types, the JVM's memory layout, object lifecycle states, common garbage‑collection algorithms, collector implementations, heap segmentation, class‑loading mechanics, and includes typical interview questions to help developers master memory management in Java.
The article explains that JDK 10 was released on March 20 2018, describes how to obtain it via the early‑access program, and details its key innovations such as local‑variable type inference, a clean garbage‑collector interface, G1 parallelization, repository consolidation, and several proposed enhancements.
This article explains Java's garbage collection mechanisms, detailing the roles and algorithms of the young generation (copying algorithm), old generation (mark‑sweep and mark‑compact), and permanent generation, along with object promotion criteria, efficiency comparisons, and memory utilization considerations.
This article investigates whether the JVM garbage collector can reclaim singleton instances that remain unused for extended periods, presenting a test program, analyzing GC logs, and explaining the GC root mechanism that keeps static singleton references alive, concluding that HotSpot 1.6 does not collect such objects.
This article provides a comprehensive overview of Java's garbage collection mechanism, memory regions, object access methods, allocation strategies, GC algorithms, and the various collectors used in the HotSpot JVM, helping developers understand and optimize Java memory usage.
When all other tuning options fail, this article guides Java developers through a systematic GC optimization process—covering essential concepts, a goal‑oriented workflow, and three real‑world case studies that illustrate adjusting generation sizes, employing CMS flags, and fixing PermGen to dramatically reduce pause times and latency.
Java's garbage collection mechanism, introduced to simplify memory management, employs various algorithms such as reference counting, tracing (mark‑and‑sweep), compacting, copying, and generational collection, each with distinct advantages, drawbacks, and implementation details, while also addressing common memory‑leak pitfalls.
This article introduces Python's object‑oriented programming fundamentals, covering class definitions, class and instance variables, the __init__ constructor, the role of self, inheritance, method overriding, built‑in class attributes, garbage collection, and private members, complemented by illustrative code snippets.
This article critically examines Go’s advertised sub‑10 ms garbage‑collection pauses, compares its concurrent mark‑sweep collector with Java’s GC algorithms, and explores the fundamental trade‑offs of throughput, pause time, memory overhead, and scalability that shape modern garbage‑collector design.
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.
This article explains the fundamentals of memory management, illustrating why ArrayBuffer and SharedArrayBuffer were added to JavaScript, how automatic garbage collection works, and what manual memory handling with functions like malloc and free entails, especially when using WebAssembly and C.