This article examines the causes of Java OutOfMemoryError in a distributed backend service, analyzes MyBatis-related memory leaks, demonstrates a reproducible scenario with large SQL concatenations and multithreading, and offers practical mitigation strategies to prevent heap and metaspace overflow.
This article explains the internal structure of ThreadLocal, identifies scenarios where ThreadLocal can cause memory leaks—especially in thread‑pool environments—analyzes the root causes, and provides practical techniques such as using remove() and expungeStaleEntry() to avoid these leaks.
After migrating a project to the MDP framework based on Spring Boot, the author observed swap overuse and physical memory far exceeding the 4 GB heap; using JVM native memory tracking, gperftools, strace, pmap, and a custom allocator, they traced a native‑memory leak to Spring Boot’s ZipInflaterInputStream during JAR scanning and resolved it by limiting scan paths.
This article explains the concept of memory leaks in Java applications, why they matter, how to identify common leak patterns and symptoms, and provides best practices, tools, and code examples for preventing, detecting, and resolving memory leaks to improve performance and stability.
An OOM crash in the K‑song iOS karaoke app was traced to a configuration that swizzled several NSMutableArray methods, causing each observer lookup to autorelease objects, rapidly filling autorelease‑pool pages and exhausting memory; converting the protection code to manual reference counting eliminated the leak and stopped the crashes.
During a load test of a Java 1.6 application on a CentOS server, memory usage climbed from 20% to 100% after an hour of 300‑concurrent requests, prompting a detailed investigation that identified off‑heap leaks caused by GZIP compression in a JimDB client and led to fixes such as upgrading the JDK and avoiding unnecessary compression.
The article details how a sudden surge in goroutine and heap usage was traced to repeatedly creating gRPC clients instead of reusing a singleton, leading to blocked goroutines and TCP connections, and explains using pprof, stack traces, and tools like goleak to detect and prevent such leaks.
This article documents a month‑long JVM garbage‑collection tuning process that reduced daily FullGC occurrences from over 40 to less than one per ten days by adjusting heap parameters, fixing memory leaks, and tuning Metaspace, while providing detailed analysis, code snippets, and performance graphs.
This article details a systematic investigation and optimization of a web‑based workflow engine, addressing slow initial rendering, input lag in Element UI components, and excessive memory consumption that caused browser crashes, and presents concrete solutions such as data pruning, Object.freeze, lazy loading, and event cleanup.
This article documents a month‑long JVM garbage‑collection tuning effort that lowered FullGC from around 40 daily occurrences to one every ten days, halved YoungGC time, identified and fixed a memory‑leak caused by anonymous inner‑class listeners, and refined heap and metaspace settings to improve overall server throughput.
The article explains Go’s runtime finalizer mechanism, shows how a single blocked finalizer can stall all cleanup callbacks, and recounts a real‑world memory‑leak incident where an unrelated goroutine’s blocked finalizer for struct B prevented struct A’s resources from being released.
This article explores Go's channel implementation—from its CSP‑inspired design and internal hchan structure to real‑world memory‑leak debugging, creation nuances, send/receive mechanics, and proper closing—providing developers with a comprehensive understanding of safe concurrent programming in Go.
The article explains Java's ThreadLocal mechanism, detailing how each thread maintains its own ThreadLocalMap, provides practical code examples, examines the underlying source implementation—including set and get methods—and discusses potential memory‑leak pitfalls and ways to avoid them.
This article walks through diagnosing V8FatalErrorCallback OOM crashes in an Electron‑based PC Taobao Live client, explores stack analysis, disables compilation cache, adjusts V8 heap limits, compiles a custom Electron without pointer compression, and uses Chrome DevTools Memory and Performance tools along with runtime monitoring to locate and fix the underlying memory leak.
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.
An unusual QR code triggers a memory‑leak in WeChat’s OCR engine, causing the app to crash on both mobile and desktop; the article explains the underlying null‑pointer exception, shows how the malformed “abnormal QR code” corrupts libqbar.so, and provides Python code to reproduce the bug using OpenCV’s open‑source QR engine.
This article explains the principles of memory leaks, details the zero‑overhead libmemunreachable detector, walks through its core algorithms and code, and describes the modifications Taobao made to enable reliable leak detection in Android release builds.
Understanding JavaScript memory management, this guide explains the fundamentals of memory allocation, usage, and garbage collection, outlines common leak scenarios such as global variables, timers, event listeners, and data structures, and provides practical techniques and tools for detecting, diagnosing, and fixing memory leaks in web applications.
This article details Quark iOS's systematic stability effort in 2022, describing how the team identified top JavaScriptCore crashes, traced them to memory‑leak and AppWorker issues, applied targeted feature toggles, upgraded SDKs, and ultimately achieved a sharp drop in overall crash rates.
This article explains how using console.log in frontend JavaScript can create memory leaks by retaining object references, demonstrates the issue with Chrome Performance and Memory tools, compares it with code without console.log, and offers alternative debugging techniques such as debugger, logpoints, and breakpoints.
The article explains how a sudden Go service memory‑usage alert was traced with go tool pprof to a massive allocation in the quantile.newStream function, uncovered a Prometheus metric‑label explosion caused by the START_POINT label, and resolved the leak by disabling that label, while also reviewing typical Go memory‑leak patterns.
The article describes analysis and resolution of full GC issues in the inventory center online business, detailing incident review, emergency measures like memory expansion and restart, root‑cause discovery of a memory leak caused by loading massive procurement out‑stock data and blocked threads, and mitigation through thread‑pool tuning, data migration, and process optimization to prevent future pauses.
Using lightweight dynamic‑tracing tools that record allocator calls and page‑fault events, the authors diagnose a production MySQL‑proxy memory leak in TDSQL, generate focused flame‑graphs with custom memstacks and pgfaultstacks, and demonstrate a fast, source‑independent alternative to gdb or Valgrind.
This comprehensive guide explains what performance testing (stress testing) is, why it matters, various test types, popular tools like ApacheBench, JMeter, LoadRunner and PTS, and provides detailed step-by-step methodologies and real-world case analyses for diagnosing memory, CPU, and latency issues in cloud‑native Java applications.
This article walks through a real‑world case of off‑heap memory leakage in the Dble proxy, detailing symptom observation, log analysis, monitoring, BTrace instrumentation, code review, and the eventual fix that delays buffer allocation until needed.
This article introduces VisualVM, a Java profiling tool bundled with the JDK, explains how to install and use its plugins for monitoring CPU, memory, threads, and garbage collection, and demonstrates step‑by‑step memory‑leak detection and remote Tomcat monitoring with code examples.
This article details a systematic investigation of a Hadoop NameNode/DataNode that showed high memory usage at 3 AM, identifies zombie crond/sendmail/postdrop processes caused by a failed Postfix service, and provides cleanup commands and preventive measures for memory, disk, and inode issues.
This article explains iOS memory architecture, the reasons behind Out‑of‑Memory (OOM) crashes, common sources of memory pressure, and practical approaches—including MLeaksFinder and FBRetainCycleDetector—to monitor, detect, and mitigate memory leaks and abnormal memory growth in iOS applications.
This article explains why non‑static inner classes in Java retain references to their outer class, causing memory leaks and eventual OutOfMemoryError, and demonstrates practical solutions such as avoiding references or converting the inner class to a static one, illustrated with code examples and debugging screenshots.
This article explains practical JVM tuning scenarios—including how to identify and resolve excessive CPU consumption, thread deadlocks, and memory leaks—by using Linux tools such as top, jstack, jps, jstat, and jmap, and by analyzing heap dumps with Eclipse MAT.
This curated collection presents insights on engineering productivity, JavaScript memory leak detection with MemLab, Rust's top challenges, V8 execution, advanced frontend tools like Lath and Plasmo, Playwright component testing, senior engineering perspectives, and practical guides on proxy patterns and Babel plugins.
This article explains Java's double‑brace initialization trick, shows how it creates anonymous inner classes, demonstrates the resulting memory‑leak and OOM risks, especially with non‑static inner classes, and provides guidelines such as using static inner classes or weak references to avoid these problems.
A production Sentinel downgrade rule triggered a severe memory leak that caused slow requests, CPU spikes, frequent full GCs, and OOM errors, which were traced to a SkyWalking bug handling empty stack traces and resolved by updating SkyWalking and adjusting Sentinel's exception handling.
After releasing a new version of a VSCode extension, intermittent freezes were traced to a memory leak; the investigation used llnode and heapdump, tackled Electron version mismatches, extended DevTools parsing limits, and ultimately identified recursive socket callbacks as the root cause.
This article details how Ctrip's hotel team used Flutter to improve app performance over two years by monitoring FPS, TTI, memory, applying widget‑tree optimizations, lazy loading, frame rendering, service‑channel enhancements with Protobuf, and systematic memory‑leak detection and mitigation.
This article explains how improper use of Java's ArrayList.subList can cause hidden memory leaks, infinite loops, ConcurrentModificationExceptions, and serialization failures in RPC frameworks, and provides concrete best‑practice solutions such as copying to a new list or using stream operations.
This technical guide explores Android out‑of‑memory crashes by classifying OOM into thread‑count, file‑descriptor, and heap‑memory issues, then details non‑intrusive thread and thread‑pool optimizations, file‑descriptor and I/O monitoring, image compression strategies, and both Java and native memory‑leak detection techniques.
This article details the technical challenges DingTalk faced when integrating Flutter across macOS and Windows desktops, covering memory leaks, shutdown deadlocks, OpenGL crashes, rendering glitches, plugin registration wild‑pointer crashes, and white‑screen issues, and explains the root causes and concrete solutions applied to each problem.
This article explains Java's ThreadLocal mechanism, detailing its internal structure, including key methods like set, get, and remove, demonstrates how improper use can cause memory leaks, and provides best practices and examples for safe usage, including InheritableThreadLocal and real-world scenarios.
This article analyzes why NSTimer can cause memory leaks in iOS, presents two ways to break the retain cycle, then dives into Android's focus system—including acquisition, distribution, and clearing—and finally explains how WebView and native code handle cookies on Android.
This article explains JavaScript's memory lifecycle, defines memory leaks, enumerates typical leak patterns such as accidental globals, timers, closures and DOM references, and describes the underlying garbage‑collection strategies (mark‑and‑sweep and reference counting) together with practical mitigation techniques.
This article walks through diagnosing and resolving two frequent Kubernetes problems—memory‑leak errors that cause "cannot allocate memory" or "no space left on device" messages, and expired cluster certificates—by checking cgroup stats, recompiling runc and kubelet, and renewing certificates with kubeadm for long‑term validity.
This article demystifies JavaScript closures, explains how V8 builds scope chains and closure objects during compilation, and demonstrates why closures can cause memory leaks by retaining references, illustrated with multiple runnable code examples and practical debugging tips.
This article reveals a subtle memory‑leak bug in Netty 4.1.56.Final’s Recycler object pool, explains its intricate lock‑free design for object allocation and recycling across threads, and walks through the discovery, analysis, and eventual fix of the issue.
This article examines Node.js hot‑update mechanisms, explains how modules like clear‑module and decache can cause memory, resource, and versioning leaks, demonstrates real‑world examples with code, and offers guidance on when hot‑reloading is safe and how to mitigate its pitfalls.
This article examines the memory‑intensive behavior of Kotlin's Kapt annotation‑processing tool in large Android builds, explains its internal two‑step stub‑generation and Java‑apt workflow, analyzes OOM root causes with VisualVM, and presents a practical source‑filtering fix that dramatically reduces compile time and memory usage.
This article analyzes a persistent full‑GC and CPU spike issue in a Dubbo microservice gateway, tracing the root cause to repeated Zookeeper subscriptions caused by timestamp‑varying URLs and offering a simple fix by disabling reference checks.
A seemingly harmless RPC framework bug caused a 4 GB byte array allocation, leading to repeated OutOfMemoryErrors in service B after service A’s deployment, and the article walks through the diagnosis, root‑cause analysis, and a simple fix.
This article investigates whether the Mapped Diagnostic Context (MDC) in Java logging can lead to memory leaks by analyzing its ThreadLocal implementation, running multiple thread‑pool scenarios, and comparing the findings with classic ThreadLocal leak cases.
The article presents eight authentic production incidents—including JVM Full GC, memory leaks, idempotency flaws, cache avalanches, disk‑I/O thread blocking, MySQL deadlocks, DNS hijacking, and bandwidth exhaustion—detailing their causes, diagnostics, and practical remediation steps for engineers.
Learn practical JVM tuning techniques by identifying high CPU usage, diagnosing deadlocks, and uncovering memory leaks using tools such as top, jstack, jps, jstat, and jmap, with step‑by‑step commands and code examples to help you optimize Java application performance.
On January 18, 2022 the Python Software Foundation released Python 3.10, 3.9, and a preview of 3.11, detailing performance gains, Windows installer issues, and a critical Cython‑related memory leak fixed in the upcoming 3.10.3 release.
This article documents a system crash triggered by a memory‑leak in a network‑chip SDK, explains how low free memory and the kswapd process lead to deadlock, and shows how adjusting the kernel parameter min_free_kbytes can prevent the freeze while highlighting the importance of resource monitoring and tuning.
This article explores Java's thread‑local storage, explaining why shared variables cause thread‑safety issues, how a proxy can hide object retrieval, the pitfalls of a naive Map‑based design that leads to memory leaks, and how the JDK's ThreadLocal uses weak references and ThreadLocalMap to safely manage per‑thread data.
Over a month we reduced Full GC occurrences from around 40 times per day to roughly one every ten days by systematically adjusting JVM parameters, addressing memory leaks, and fine‑tuning metaspace and young generation settings, ultimately achieving lower GC pause times and higher server throughput.
This article analyzes why Flutter apps suffer from high memory usage, identifies BuildContext and State as primary leak sources, and proposes a comprehensive, automated detection tool inspired by Android LeakCanary that accurately and efficiently finds memory leaks in production Flutter applications.
Full‑chain load testing uncovered a Redis large‑key bottleneck that saturated bandwidth, a memory‑leak caused by repeatedly registering shutdown hooks, and persistently high JVM heap usage, leading to solutions of key sharding with local caching, registering hooks only once, and adjusting heap size, physical memory, and alert thresholds.
This article explains why iOS memory leaks become critical as apps grow, introduces five representative leak models, details a production‑ready object‑graph scanning solution with custom data structures and a non‑recursive DFS algorithm, and evaluates its performance impact and mitigation strategies.
This article examines a user‑side logging system where encrypted and compressed logs are uploaded, analyzes why decryption often stalls or fails, explores Node.js multi‑process and inter‑process communication methods, addresses sticky‑packet and exception handling issues, and presents solutions for performance, memory leaks, and reliable npm package publishing.
This article explains common Kubernetes issues such as node memory leaks and certificate expiration, provides diagnostic commands, and offers detailed solutions including disabling kmem accounting, recompiling runc and kubelet, and extending certificate validity to ten years.
This article explains the fundamentals of iOS memory management, describes common memory‑leak scenarios such as circular references, introduces detection tools like MLeaksFinder and FBRetainCycleDetector, and provides concrete code examples and best‑practice techniques for preventing and fixing retain cycles in production apps.
Facing 8‑minute Gradle syncs, frequent GC‑over‑limit errors, and excessive memory usage, the team diagnosed severe memory leaks in Android build configurations, applied variantFilter filtering, tuned JVM arguments, and optimized daemon settings, ultimately reducing sync time to 1.5 minutes and cutting CI build time in half.
This article explains why Node.js services can suffer from memory leaks, explores a V8 engine bug involving generators, walks through heap snapshot comparison and MAT analysis, lists common leak patterns, and presents practical tools and upgrade strategies to resolve the issue.
After a late‑night incident where a Dubbo 2.7.12 service crashed, the author traced high memory and CPU usage to a full GC spike, identified a HashedWheelTimer thread‑pool bug causing request timeouts to be missed, reproduced the leak, and confirmed the issue was fixed in Dubbo 2.7.13.
This article explains the two primary use cases of ThreadLocal in Java—providing each thread with its own exclusive object and sharing request‑scoped data across methods—while covering implementation details, memory‑leak risks, and best‑practice cleanup techniques.
The iQIYI deep‑learning platform identified two TensorFlow Serving memory‑leak problems—a string‑accumulating executor map caused by unordered input maps and an uncontrolled gRPC thread surge under heavy load—submitted upstream patches that sort inputs and cap thread counts, eliminating OOM crashes and stabilizing production.
This article explains what memory leaks are, how to identify them in Vue SPA projects using Chrome's memory tools, lists common leak patterns, and provides practical code‑level solutions—including proper event unbinding, timer cleanup, and correct use of keep‑alive—to keep your application performant.
In a high‑throughput mobile push service built on Netty, an off‑heap memory leak was traced to unchecked ChannelOutboundBuffer growth when half‑closed connections remained active but unwritable; fixing it by disabling autoRead on unwritable channels, configuring write‑buffer watermarks, and adding explicit isWritable() checks eliminated the crash and stabilized the system.
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 explains what memory leaks are in JavaScript, how to detect them using Chrome's memory tools, enumerates common causes in Vue SPAs, and provides practical solutions and code examples—including event unbinding and keep‑alive refactoring—to effectively eliminate leaks and improve performance.
The case study walks through debugging a Go production service that regularly spiked to over 6 GB of resident memory, revealing that unbuffered channel leaks, mis‑configured HTTP client timeouts, and ultimately a cgo‑based image‑processing library spawning unmanaged threads caused the leaks, and outlines a systematic troubleshooting workflow.
The article describes how the MOO app team used Flutter's Dart VM Observatory and Allocation Profile tools to detect and fix an image memory leak caused by a custom painter not deregistering an ImageStreamListener, demonstrating step-by-step snapshot comparison, reference‑chain analysis, and the resulting memory stabilization after code fix.
The article shows how to detect and stop memory leaks in web pages with Chrome DevTools—using heap snapshots, allocation‑instrumentation timelines, and the Performance panel—to expose leaks from globals, closures, detached DOM nodes, excess elements, or console logging, and offers practical coding guidelines to avoid them.
This article walks through a production JVM memory‑leak incident, detailing how a static LRU cache built on LinkedHashMap caused unreclaimed objects, the concurrency pitfalls of its design, and practical steps to diagnose and fix such leaks in Java backend systems.
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.
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 explores the distinction between OutOfMemory errors and memory leaks in Java, examines how improper use of static fields, unclosed streams, incorrect equals/hashCode implementations, and ThreadLocal can cause leaks, and provides practical solutions and tools such as JVisualVM to detect and prevent these issues.
JVisualVM, bundled with JDK, provides a visual interface to monitor JVM threads, memory, and CPU usage, allowing installation of plugins for GC, thread, and memory analysis, demonstrating how to simulate memory leaks, capture heap dumps, compare snapshots, trace object references, and set up remote Tomcat monitoring via JMX.
After a new feature rollout caused a sudden CPU surge and thousands of Dubbo threads to stall, this article walks through log inspection, code review, thread‑dump analysis, and memory‑leak detection to uncover the root cause and suggest concrete optimizations.
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.
The article recounts a weekend on‑call incident where a Java monitoring service suffered network packet loss and a severe memory leak, leading to massive timeouts, high CPU usage, and frequent GC, and explains how the problem was diagnosed and resolved using tools such as top, jstat, jstack, jmap, and MAT.
This article explains three common ThreadLocal misuse traps—memory leaks caused by weak‑referenced keys, loss of thread‑local context in thread‑pool workers, and context disappearance in parallel streams—provides detailed code examples, and offers practical guidelines to prevent them in Java backend applications.
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 article walks through using Python's zipfile module to brute‑force an encrypted ZIP password, demonstrates a multithreaded approach that initially exhausts memory, and shows how replacing ThreadPoolExecutor's unbounded queue with a bounded one resolves the issue.
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 what ThreadLocal is, demonstrates how it works with and without it, analyses its source code, discusses potential memory‑leak issues, and provides best‑practice guidelines and a Spring‑Boot example for safe usage in multithreaded Java applications.
The article walks through a real‑world Java production incident where CPU spiked to 100%, detailing systematic troubleshooting steps, heap analysis with MAT, and the discovery that repeatedly creating BouncyCastleProvider objects caused a memory leak that was fixed by refactoring the code.
The article details a thorough investigation of native‑memory crashes in the K歌 Android app, describing how memory usage was profiled, comparing three analysis tools, building a custom loli_profiler‑based hook to track malloc/free and bitmap allocations, exposing leaks, and outlining fixes and future optimization plans.
This tutorial walks Java developers through using VisualVM to monitor JVM threads, memory, and CPU, demonstrates how to create a memory‑leak scenario, generate heap dumps, and interpret VisualVM and Visual GC data to pinpoint memory‑leak root causes.
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 inner workings of Java's ThreadLocal, covering its storage mechanism, ThreadLocalMap structure, get/set/remove operations, thread isolation, potential memory leak pitfalls, and provides a practical demo program to illustrate proper usage.
This article provides a detailed technical analysis of LeakCanary 2.0, covering its Kotlin‑based integration, the new self‑implemented Hprof parser, detection workflow, core classes such as AppWatcher and ObjectWatcher, graph indexing, and the algorithm used to locate the shortest GC‑root leak path.
This article investigates why an InfluxDB 1.8 instance on a 32‑core, 64 GB server consumes over 58 GB of resident memory and generates heavy disk I/O, examines Go runtime memory accounting, uses system tools such as top, pmap, pprof and iostat for diagnosis, and presents configuration and runtime tweaks that reduce memory pressure and I/O load.
The article investigates why an InfluxDB 1.8 instance on a 32‑core, 64 GB production server consumes over 95% memory and generates heavy disk I/O, analyzes runtime statistics, pprof data, and Go memory‑release behavior, and presents configuration and runtime tweaks that reduce memory usage to ~55% and I/O load to acceptable levels.
The article shows how to generate a Node.js V8 heap snapshot with v8.getHeapSnapshot, explains the JSON‑like .heapsnapshot structure of nodes, edges, and strings, and demonstrates using the heapquery tool to import the data into SQLite for SQL queries that locate and trace memory‑leaking objects such as a HugeObj instance.