After migrating a project to the MDP framework based on Spring Boot, the system repeatedly reported excessive swap usage; the investigation revealed that native memory allocated by the Spring Boot classloader’s Reflections scanning and InflaterInputStream caused 700 MB–800 MB of off‑heap memory to remain unreleased, which was eventually resolved by limiting the scan path and updating Spring Boot.
Memory leaks, caused by unreleased dynamic allocations, can accumulate and lead to memory overflow, severely degrading performance or crashing applications; this article explains leak definitions, causes, classifications (persistent, intermittent, one‑time, implicit), overflow reasons, and practical mitigation steps such as proper allocation, deallocation, and JVM tuning.
The article walks through a real‑world Java service outage caused by CPU saturation, details a systematic five‑step investigation, reveals a memory leak in BouncyCastleProvider objects within JceSecurity, and explains how converting the provider to a static singleton resolved the issue.
The article shares eight concrete production incidents—from JVM Full GC spikes and memory leaks to cache avalanches, deadlocks, DNS hijacking and bandwidth exhaustion—detailing their root causes, step‑by‑step diagnostics, code snippets, monitoring tricks and practical remediation measures for engineers.
The analysis reveals that on Vivo devices running Android 9, a static AsyncTask SERIAL_EXECUTOR blocks the UpdateBottomFlagTask in several order‑related activities, leaking the Activity context, and the fix replaces this executor via reflection with a custom parallel SerialExecutorProxy to prevent the leak.
This article explains how ThreadLocal works internally, demonstrates its typical use in a Spring single‑sign‑on interceptor, analyzes the source code of ThreadLocal and ThreadLocalMap, and reveals the conditions under which ThreadLocal can cause memory leaks, offering practical guidance to avoid them.
This article introduces JVisualVM, explains how to install and use its plugins for monitoring threads, CPU, memory and GC, demonstrates a Java memory‑leak simulation with code and JVM options, shows step‑by‑step analysis of heap dumps, and describes remote Tomcat monitoring via JMX.
This article explains why C heap memory leaks cause board resets after months of operation, describes heap allocation methods, the three key leak elements, common release misconceptions, and provides practical code‑review techniques to detect and eliminate leaks.
This article explains the internal mechanism of Java's ThreadLocal, how each thread maintains its own isolated map, why weak references are used for keys, and how improper cleanup in thread‑pool environments can lead to subtle memory‑leak problems.
This article recounts a real‑world incident where a simple JSON.parse() try‑catch block triggered a massive memory leak in a Node.js 12 application, explains how the V8 engine’s script_list retained orphaned script objects, and shows how tools like gdb, llnode and heapdump can be used to locate and fix the issue.
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.
Learn how to export a live heap dump from a Java service, use JProfiler 9.x to open the .hprof file, identify large objects such as Zipkin's InMemoryReporterMetrics, and pinpoint memory leaks that can consume gigabytes of RAM.
The article details a step‑by‑step investigation of abnormal swap memory consumption in a Spring Boot project, revealing that native memory allocated by the Inflater during JAR scanning was not released promptly, leading to apparent memory leaks that were ultimately resolved by configuring package scanning and updating Spring Boot.
The article shares seven authentic production incident cases—from JVM Full GC spikes and memory leaks to cache avalanches, disk I/O blocks, database deadlocks, DNS hijacking, and bandwidth exhaustion—detailing root causes, step‑by‑step troubleshooting methods, code snippets, and practical mitigation strategies for engineers.
A newly hired architect boasts high‑concurrency expertise but writes un‑commented Java code that misuses ConcurrentHashMap, leading to memory leaks; the ensuing investigation reveals missing equals/hashCode implementations, race conditions in a visit method, and a debate between synchronized blocks and putIfAbsent for safe updates.
This article explores the distinction between OutOfMemory errors and memory leaks in Java, explains how improper use of static fields, unclosed streams, incorrect equals/hashCode implementations, and ThreadLocal can lead to leaks, and provides practical solutions and tools such as JVisualVM to detect and prevent them.
A senior architect’s over‑confident, un‑commented Java code using ConcurrentHashMap triggered a severe memory leak, revealing pitfalls in hashCode/equals implementation, non‑atomic map updates, and the trade‑offs between synchronized blocks and putIfAbsent for high‑concurrency monitoring.
After migrating a project to the MDP framework based on Spring Boot, the author observed excessive swap usage and physical memory consumption of 7 GB despite a 4 GB heap limit, and through a series of JVM, system, and native‑code diagnostics identified Spring Boot’s ZipInflaterInputStream native‑memory leak caused by unchecked package scanning.
The article details a step‑by‑step investigation of why a Spring Boot service migrated to the MDP framework consumed far more physical memory than its 4 GB heap, revealing native‑code allocations, memory‑pool behavior of glibc and tcmalloc, and how limiting MCC scan paths or upgrading Spring Boot resolves the off‑heap leak.
The article details a step‑by‑step investigation of a Spring Boot application that unexpectedly used 7 GB of physical memory despite a 4 GB heap limit, revealing how native memory allocations, the Inflater class, and glibc memory pools caused off‑heap leaks and how proper configuration and library updates resolved the issue.
This article explains that Spring does not guarantee thread safety for its beans, describes the various bean scopes, clarifies why stateless singleton beans are safe, and shows how ThreadLocal works—including its implementation, usage, and potential memory‑leak pitfalls—so developers can write correct concurrent code.
This article explains the purpose and internal mechanics of Java's ThreadLocal class, walks through its core source‑code methods (get, set, remove, etc.), discusses memory‑leak pitfalls and mitigation, and outlines common usage patterns and interview questions for developers.
After moving a project to Spring Boot, the system reported unusually high swap usage despite a 4 GB heap, prompting a detailed investigation using JVM native‑memory tracking, pmap, gperftools, strace, and GDB, which ultimately identified Spring Boot’s JAR scanning and glibc memory arenas as the root causes and led to a configuration fix and an upgrade to resolve the off‑heap memory leak.
This guide explains how to use GCC's built‑in AddressSanitizer to detect memory leaks, heap/stack/global buffer overflows, use‑after‑free, and initialization‑order bugs, providing sample code, compilation flags, and example outputs for each error type.
This article investigates a socket memory leak on a single server using Jedis, revealing how frequent pool eviction, mis‑configured minIdle settings, and Java finalizer behavior combine to create excessive socket objects and strain the garbage collector.
This article examines why MySQL instances are often targeted by the Linux OOM killer, explains proper InnoDB buffer pool sizing, introduces memory leak concepts, and demonstrates how to use Valgrind's Memcheck tool to detect leaks and improve database memory management.
ThreadLocal provides thread‑confined variables in Java, eliminating race conditions without synchronization; this article explains its concept, demonstrates usage with code examples, analyzes the underlying ThreadLocalMap implementation, discusses hash calculations, potential memory‑leak pitfalls, and outlines common application scenarios.
This article details a step‑by‑step investigation of excessive native memory usage in a Spring Boot service, explaining how JVM tools, system tracers, and custom allocators revealed that the default MCC package scanner and Inflater implementation caused a hidden memory leak that was fixed by configuring scan paths and upgrading Spring Boot.
This article details a step‑by‑step investigation of unusually high native memory consumption in a Spring Boot service, covering JVM configuration, system‑level diagnostics with jcmd, pmap, gperftools, strace, GDB, and jstack, and explains how the MCC component’s default package scanning caused the leak and how configuring scan paths or upgrading Spring Boot resolved the issue.
A Spring Boot project migrated to the MDP framework exhibited excessive native memory usage, leading to swap errors; the article details step‑by‑step investigation using JVM tools, system utilities, and custom allocators to pinpoint and resolve the hidden native memory leak caused by unchecked JAR scanning and glibc memory pools.
The Redis website experienced an unexpected outage caused by an OOM error due to insufficient memory on a low‑cost DigitalOcean droplet, and the maintainer quickly fixed it by upgrading the instance and limiting allkeys‑lru usage, revealing surprising details about the site’s infrastructure.
A misconfigured Dubbo consumer created both Dubbo and REST invokers, causing thousands of failed REST invoker attempts that filled a synchronized List of ResteasyClient objects, exhausting the old generation heap and triggering OOM, which was fixed by replacing the List with a WeakHashMap‑based client map.
This article explains what ThreadLocal variables are, how they are implemented in Java using a per‑thread ThreadLocalMap, discusses potential memory‑leak pitfalls caused by weak keys, and demonstrates common usage scenarios such as per‑thread session storage and making non‑thread‑safe classes like SimpleDateFormat thread‑safe.
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 describes how to reduce recommendation service response time by refactoring code, configuring log levels per deployment group, using environment variables, and diagnosing performance issues through GC analysis, thread monitoring, and memory leak detection, achieving an average latency reduction of over 30 ms.
This article explains how Spring bean scopes affect thread safety, why most beans are safe when stateless, how to use ThreadLocal correctly, its internal hash‑map design, and the memory‑leak pitfalls that arise when ThreadLocal entries are not cleaned up.
This article details a step‑by‑step investigation of repeated follower process alerts in a Paxos‑based distributed coordination service, revealing a Java GC pause‑induced memory leak in the front‑end Proxy and describing the rapid mitigation actions taken to restore system stability.
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.
During a weekend on‑call shift a Java detection service repeatedly timed out due to network packet loss, leading to massive CPU usage and full GC cycles caused by a memory leak in a Map that stored request results, which was finally diagnosed and resolved using JVM tools like jstat, jstack, and MAT.
This tutorial explains what Java memory leaks are, why they happen despite garbage collection, shows common leak patterns such as static fields, unclosed resources, improper equals/hashCode, inner classes, finalize, constant strings and ThreadLocal, and provides practical detection and prevention techniques.
This article explains why improper use of ThreadLocal can lead to memory leaks in Java, details the underlying weak‑reference mechanism, and provides practical steps—including explicit removal and Spring integration—to safely manage ThreadLocal data and avoid resource exhaustion.
The Probe component continuously monitors Android app memory, automatically captures trimmed HPROF snapshots when usage spikes, and analyzes them either on‑device with the HAHA library or on a server, enabling rapid OOM root‑cause localization, thread/FD tracking, and has lowered the rider app’s crash rate from 2‰ to roughly 0.02‰.
This article walks through a real‑world Node.js out‑of‑memory crash, explains how to detect the OOM killer via system logs, uses Heap Profiler and process.memoryUsage() to pinpoint memory growth, and presents a practical fix by throttling file‑write operations and improving monitoring.
The article explains how Java 8 parallel streams in Tomcat containers trigger class‑loading failures because ForkJoinWorkerThreads inherit a null context class loader after Tomcat 7.0.74 introduced SafeForkJoinWorkerThreadFactory, leading to deserialization errors and memory‑leak risks, and recommends avoiding dynamic class loading or using custom thread pools.
This article explains the contract between hashCode() and equals() in Java, shows the problems caused by violating it—such as incorrect behavior in HashMap/HashSet and memory leaks—and provides practical guidelines and code examples for implementing robust hashCode methods, including the use of Apache's HashCodeBuilder.
The article demonstrates how Go’s built‑in pprof tools can be used for live performance profiling, walking through two real‑world cases—one where a malformed JSON request caused massive object allocation and CPU spikes, and another where per‑call self‑referencing structs leaked memory—while offering practical tips on input validation, allocation reduction, and GC monitoring.
A sudden surge of requests triggers e.printStackTrace() to flood the JVM's non‑heap string pool, exhausting memory, blocking threads, and causing the entire Java web service to become unresponsive, highlighting the dangers of careless exception logging.
This article explains the purpose and usage scenarios of Java's ThreadLocal, details its two main functions for storing thread context and ensuring thread safety, discusses garbage‑collection nuances, presents sample code with results, and outlines essential best‑practice guidelines for safe multithreaded development.
This article enumerates the most frequent Java OutOfMemoryError scenarios—including heap space exhaustion, GC overhead limits, oversized array allocations, PermGen/Metaspace depletion, thread creation failures, and native method errors—detailing their causes and practical JVM flag or code fixes to resolve them.
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 walks through the root cause analysis of an OutOfDirectMemoryError in a Netty‑based MQTT IoT broker, detailing how to detect off‑heap memory leaks, monitor them with BTrace and custom metrics, and apply proper ByteBuf release and configuration fixes.
Printing a Java exception stack trace with e.printStackTrace() can exhaust the non‑heap string pool, causing request threads to block and the entire web application to appear dead‑locked, especially under heavy load.
This article introduces the WAPM performance monitoring SDK for Android, detailing its four‑layer architecture, memory‑leak detection via LeakCanary, UI thread jank analysis using Looper callbacks, network request monitoring through framework hooks, and page load timing via activity and view lifecycle instrumentation.
After observing a Java process with persistently high memory usage, the article details a step‑by‑step investigation using top, ps, GC logging, and jmap to identify a memory leak caused by a third‑party jar, and shows how adjusting JVM parameters and fixing the code resolved the issue.
During a weekend on‑call shift a Java monitoring service repeatedly timed out due to network packet loss and a severe memory leak, leading to massive CPU usage and full GC cycles, which were diagnosed with jstat, jstack, heap dumps and MAT before the leak was eliminated.
This article shares practical experiences from unit testing a 6000‑line C module, detailing static code review and dynamic gtest testing, uncovering common defects such as memory leaks, and presenting two memory‑leak case studies with root‑cause analysis and cleanup recommendations.
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.
After moving to Spring Boot, the application consumed up to 7 GB of native memory because Meituan’s MCC package scanner invoked Spring’s ZipInflaterInputStream, which allocated large off‑heap buffers during JAR decompression that were only freed by the JVM finalizer and retained by glibc’s 64 MB arenas; restricting the scan scope or upgrading to Spring Boot 2.0.5 eliminated the excess usage.
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.
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.
This article shares WeChat's engineering experience in detecting and preventing various Android memory leaks—including Activity, Bitmap, native, and thread leaks—by building custom tools, refining monitoring pipelines, and applying fallback protection to keep the app stable at scale.
This article details a step‑by‑step investigation of frequent full GC events and high CPU usage in a Java backend service, covering memory analysis with SGM, heap dumps, identification of large Base64 image strings, static encryption utilities, and remediation actions such as heap size increase and custom encryption handling.
When a WebSocket‑based service built on Netty started returning massive 5xx errors, we used log analysis, CAT monitoring, reflective access to Netty's internal memory counter, and step‑by‑step debugging to locate and fix an off‑heap memory leak caused by a null subType field in the encoder.
The article walks through diagnosing a Java memory leak by examining Full GC symptoms, using jstat, jmap, and BTrace to identify excessive Hashtable entries, tracing the offending code, and preparing for targeted optimization.
A production Elasticsearch 5.3.2 cluster showed a persistent 80% heap usage due to a hidden memory leak caused by Log4j thread‑local objects retaining large bulk request data, and the article walks through the investigation, heap‑dump analysis, source‑code tracing, and a practical fix using a JVM flag.
The article explains how a repeating iOS animation caused a hidden memory leak by retaining its view controller through a strong CABasicAnimation delegate and a performSelector‑afterDelay timer, and shows how replacing the delegate‑based animation with a CAKeyframeAnimation/CAAnimationGroup and using weak references or cancelling pending selectors eliminates the retain cycle.
The Meituan Waimai Android team cut crash rates from 0.3% to 0.02% by applying systematic crash governance, null‑pointer and OOM safeguards, AOP bytecode rewriting, dependency checks, modular architecture, and robust monitoring, offering a comprehensive blueprint for other Android teams to improve stability.
This article details a step‑by‑step investigation of a Java backend service outage caused by metaspace exhaustion due to repeated JAXBContext creation, including monitoring, dump analysis, code verification, and the final solution of caching JAXBContext and limiting metaspace size.
This article examines common memory leak and performance problems in C/C++ applications, categorizing causes such as pointer loss, improper memory release, excessive fragmentation, infinite allocation, and container misuse, and discusses diagnostic techniques, underlying allocation mechanisms, and mitigation strategies.
This article shares practical experiences from unit testing a critical C module, describing common memory‑leak scenarios, their root causes, and concrete solutions while also offering a checklist of typical leak‑prone patterns for developers.
This report details how integrating OSP Proxy as an SDK into the Netty‑based Janus gateway dramatically improves throughput, yet introduces a 100 KB payload memory‑leak bug, analyzes its root causes, and evaluates mitigation strategies such as connection and worker‑thread tuning.
After deploying a Python server for receiving DICOM medical images, the author encountered severe memory consumption, investigated the leak using tools like gc, objgraph, tracemalloc, and pyrasite, identified a self‑referencing DicomFileLike object with a __del__ method, and resolved the issue by patching the code.
This article explains how misuse of ThreadLocal in Java thread pools can cause memory‑leak‑induced Out‑Of‑Memory errors, illustrates the problem with a reproducible example, analyzes the underlying ThreadLocalMap mechanics, and provides best‑practice guidelines such as invoking remove() to avoid leaks.
The article details how to identify and resolve memory leaks and performance bottlenecks in high‑concurrency Nginx workloads using tools such as Valgrind, AddressSanitizer, perf and flame‑graphs, while also sharing practical tips and personal reflections on debugging under pressure.
This article explains why Node.js applications suffer memory leaks, describes V8's memory limits and garbage‑collection behavior, outlines common leak causes, and provides step‑by‑step techniques and tools for monitoring, diagnosing, and resolving leaks in production code.
This article explains how a Janus service gateway ran out of memory due to unreleased Netty off‑heap ByteBufs, how enabling Netty's leak detection and adjusting JVM parameters helped reproduce the issue, and how to fix the leak by explicitly releasing the buffers.
This tutorial explains how to install and use the devtool utility to monitor, capture heap snapshots, and analyze memory usage in a Node.js application, demonstrating the detection of memory leaks through practical examples and timeline visualizations.
This article walks through a real‑world MySQL 5.7 memory‑leak case, showing how to use performance_schema, pmap, and thread analysis to identify runaway threads and fix the issue by closing unclosed cursors.
This article explains common Android performance problems such as high battery consumption, slow startup, memory leaks, and UI jank, and provides step‑by‑step methods using Android Studio, MAT, GPU rendering analysis, FPS Meter, and command‑line tools to locate and resolve these issues.
An Oracle RAC deployment across four identical clusters repeatedly experienced node crashes, each traced to ocssd.bin failures caused by a memory leak bug in CRSD/OCSSD processes (Bug 11704113), with analysis of logs, kernel parameters, and recommended patches and configuration tweaks to prevent recurrence.
This article explains what memory leaks are on Android, outlines their common sources, introduces various detection tools such as Lint, StrictMode, LeakCanary, Android Memory Monitor, MAT and adb commands, and provides practical strategies for locating and fixing leaks in mobile apps.
This article outlines four frequent Node.js operational problems—memory leaks, CPU bottlenecks, back‑pressure, and security risks—and provides practical solutions such as heap‑dump analysis, CPU profiling, APM monitoring, and using private npm registries with tools like Snyk to secure dependencies.
This article explains why Node.js applications can suffer memory leaks due to V8 garbage‑collection limits, describes V8 memory regions and GC types, and provides practical commands, monitoring tools, and a reproducible code example to identify and resolve leaks.
This article explains why Android apps encounter OutOfMemoryError, distinguishes memory leaks from heap overflow, and provides step‑by‑step guidance on using LeakCanary and the Eagle plugin for Eclipse to detect, compare, and fix memory leaks in Java applications.
This article walks through a real‑world investigation of intermittent core dumps and memory leaks in a heavily modified Nginx + OpenSSL stack under extreme QPS, detailing debugging strategies, custom load‑testing tools, and performance‑profiling techniques that helped pinpoint and fix the root causes.
The article describes a real‑world investigation of extremely low‑probability core dumps and memory leaks in a heavily modified Nginx + OpenSSL stack, detailing the debugging workflow, custom high‑concurrency test harness, use of tools such as GDB, perf, Valgrind, AddressSanitizer, and the performance‑hotspot analysis that ultimately resolved the issues.
This article outlines a practical workflow for diagnosing and fixing memory leaks in Node.js applications, covering essential concepts of V8 garbage collection, recommended tooling such as devTool, heapdump, and memwatch, and detailed steps for reproducing issues, capturing heap snapshots, analyzing them, and applying fixes.
This guide explains practical techniques for diagnosing Node.js production issues, covering request‑latency analysis, CPU profiling with perf and FlameGraph, crash investigation via Core Dumps and mdb_v8, and memory‑leak detection using gcore and mdb_v8 diff tools.
This article analyzes how improper use of Node.js's VM module leads to high CPU and memory consumption, explains the underlying contextify and Persistent handle mechanisms, and presents three practical solutions plus diagnostic tools to prevent and troubleshoot such performance issues.
The article presents a detailed case study of an Android WebView memory‑leak bug that gradually slows page opening, explains how DDMS and MAT were used to pinpoint the leaking DynamicBgDrawable objects, and describes the fix of converting a strong view reference to a weak reference to eliminate the leak.
The article presents a detailed case study of an Android WebView memory leak that causes progressively slower page loads, explains how DDMS and MAT were used to pinpoint the leak in DynamicBgDrawable via a WeakHashMap reference cycle, and proposes converting the view reference to a weak reference to resolve the issue.
This guide explains practical techniques for spotting basic memory leaks, using the MAT tool to analyze heap dumps, comparing hprof files, and implementing daily leak monitoring in Android apps through AspectJ instrumentation, MLD utilities, and UIAutomator automation.
The article explains why repeatedly redeploying a Java servlet can trigger a java.lang.OutOfMemoryError: PermGen space, describes how classloader leaks occur, illustrates the problem with memory diagrams, and offers practical tips for detecting and fixing such leaks in backend applications.
This article analyzes common push‑service questions, presents a memory‑leak case from an IoT MQTT middleware, and provides detailed Netty design guidelines—including file‑handle limits, CLOSE_WAIT handling, thread and task management, heartbeat tuning, buffer allocation, memory‑pool usage, logging pitfalls, TCP and JVM optimizations—to help engineers build stable, high‑performance million‑connection push servers.
Various techniques for deliberately creating memory leaks in Java are presented, including using long‑running threads with custom class loaders, static references, ThreadLocal misuse, improper handling of resources like connections and streams, and flawed implementations of hashCode/equals, each illustrated with code examples.