This article presents a systematic, evidence-driven framework for Go memory optimization, covering allocation profiling, GC tuning, container memory accounting, runtime metrics observability, and validation methodologies to prevent Kubernetes OOM kills while meeting SLOs.
This comprehensive guide covers four Java OOM types (heap, metaspace, stack, direct memory), details enterprise troubleshooting SOP using jmap and MAT analysis, identifies five common memory leak root causes, and provides a six-step production emergency response plus long-term prevention rules.
A Java thread pool that looks larger can actually cause out‑of‑memory errors when core parameters such as core size, max size, queue type, keep‑alive time, thread factory, and rejection policy are mis‑configured, leading to uncontrolled task accumulation and resource exhaustion in production.
The article explains that out‑of‑memory (OOM) events can happen despite apparent free memory because OOM can be triggered by cgroup limits, NUMA constraints, kernel allocation failures, or systemd‑oomd policies, and it provides a step‑by‑step diagnostic method covering logs, metrics, and Kubernetes specifics.
Even when monitoring shows free memory, Linux can still kill processes due to various OOM paths such as cgroup limits, NUMA allocation failures, kernel high-order allocation issues, or systemd‑oomd, and this guide walks through a reproducible investigation and remediation process.
Even with 2 TB of RAM, PostgreSQL can hit OOM because work_mem is a per‑operation budget that multiplies across sorts, hashes, parallel workers and long‑lived memory contexts, so blindly raising it often hides deeper query‑design and statistics issues.
A Go compiler issue shows that an exponentially growing string constant can exhaust memory during compilation, causing an out‑of‑memory crash, and the article explains how the constant is built, why it differs from variables, historical related bugs, the core team's mitigation plans, and practical safeguards for code generators and online compilers.
The article explains why increasing PostgreSQL's work_mem does not guarantee per‑query memory limits, how multiple sort/hash nodes, parallel workers and long‑lived memory contexts can cause OOM even on a 2 TB server, and offers concrete diagnostics and mitigation strategies for DBAs and developers.
This article systematically breaks down Linux's core memory mechanisms, identifies common performance bottlenecks, and demonstrates how to use tools like numastat, perf, and Valgrind together with kernel parameters such as swappiness and min_free_kbytes to achieve practical memory optimizations.
This article analyzes why vLLM's PagedAttention can cause GPU memory fragmentation and out‑of‑memory errors in production, presents four typical OOM scenarios, and provides concrete diagnostics, configuration tweaks, code examples, and monitoring strategies to eliminate the problem.
The article walks through a 13‑hour out‑of‑memory incident on a Spring Boot 2.7 service running in Kubernetes, detailing how to preserve the crash dump, interpret GC logs, use MAT and Arthas to pinpoint a static HashMap leak, and apply both temporary and permanent fixes while hardening the system for future safety.
This article explains how Java source files are compiled into bytecode, details the JVM's class loading lifecycle, describes the hierarchical class loader delegation model, and breaks down the runtime data areas—including stack, heap, and metaspace—while offering practical tuning tips to avoid common OOM issues.
This article explains what backpressure is, why Node.js services silently run out of memory, and provides practical streaming and bounded‑concurrency patterns with code examples to keep memory usage stable under load.
This article walks through a real‑world Java service on Kubernetes, detailing the initial confidence, recurring OOM and rollout issues, and a multi‑round remediation that introduced container‑aware JVM settings, refined resource requests, OOM dumps, probes, and metrics, ultimately achieving three years of stable operation with lower resource usage.
This article delves into the hidden iOS OOM crashes, explains the Jetsam watchdog mechanism, the role of phys_footprint, compares industry solutions, and provides step‑by‑step implementations for monitoring, allocation tracking, and proactive memory‑management strategies to prevent silent terminations.
This article examines why vLLM experiences out‑of‑memory errors in production, explains memory fragmentation caused by PagedAttention, outlines four typical OOM scenarios with concrete command‑line solutions, and provides deep analysis, configuration scripts, dynamic tuning, troubleshooting flowcharts, monitoring alerts, and best‑practice recommendations.
A StarRocks case study shows how early null filtering and Bloom indexes reduced a 200M-row query from 12s to under 1s while eliminating CN node OOM restarts through predicate pushdown and partition pruning.
This comprehensive guide turns interview preparation into a performance, offering a step‑by‑step "now‑past‑future" script for self‑introductions, STAR‑based storytelling for challenging projects, concrete Java OOM troubleshooting examples, and proven tactics for answering why you left, strengths, pressure handling, and salary expectations.
This article reveals how Linux kernel memory layout—its partitions, address allocation, and resource scheduling—directly impacts system stability, explains the roles of each memory region, demonstrates common pitfalls like fragmentation and dentry leaks, and provides practical debugging and optimization techniques for developers and operators.
When migrating automotive workloads to cloud-native containers, unexpected OOMKilled pods often hide a large amount of Java memory consumption caused by JNI, libc, and Transparent Huge Pages, which can be identified and resolved using the Alibaba Cloud OS Console's memory panorama analysis and hotspot tracing features.
This article walks through a real‑world OceanBase cluster outage, detailing the environment, emergency restart steps, log‑driven fault analysis of disk I/O failures and Linux OOM‑killer activation, and presents concrete mitigation measures to prevent similar incidents.
The article walks through a real‑world OOM incident in a high‑traffic hotel information service, detailing the root‑cause analysis of memory exhaustion, JVM heap configuration, GC behavior, heap‑dump inspection, and the concrete optimizations applied to prevent similar failures.
This article examines recent efforts to make Linux kernel memory management programmable with eBPF, covering BPF‑MM patches for mTHP order, cache‑ext’s customizable LRU, FetchBPF prefetch policies, and BPF OOM hooks, and discusses their design, implementation details, and performance impacts.
This guide explains how to troubleshoot common online Java problems—including high CPU, OutOfMemoryError, disk I/O, and network latency—by using tools such as top, jps, jstack, jmap, MAT, df, and ping to pinpoint root causes like infinite loops, memory leaks, lock contention, and resource exhaustion.
The article recounts a series of three OOM incidents in a production service that combines Paimon data lake and RocksDB via an SDK, detailing the step‑by‑step investigation, the discovery of excessive bucket‑driven thread creation and off‑heap memory leaks, and the final mitigation measures that restored stability.
This article explains how memory works as a temporary storage stage for processes, describes the fundamentals of physical and virtual memory, details paging, page tables, multi‑level paging, allocation mechanisms such as brk() and mmap(), and outlines Linux memory‑management techniques including caching, swapping, and OOM handling.
The article lists the most frequent Java OutOfMemoryError variants, explains their root causes and typical scenarios, provides concrete code examples that trigger each error, and offers practical troubleshooting steps and JVM tuning recommendations for interview preparation.
This guide explains how to automatically capture Java OOM heapdump files using a DaemonSet that watches for heapdump.prof creation, compresses and uploads them to Alibaba Cloud OSS, and notifies developers via a WeChat bot, providing a scalable, non‑intrusive solution for memory‑leak diagnostics in Kubernetes environments.
This article documents a step‑by‑step investigation of a Java 11 application that suffered OS‑level OOM despite a 4 GB heap, revealing that multiple Netty PooledByteBufAllocator instances loaded by different class loaders consumed far more native memory than expected.
An Nginx‑based data collection gateway began crashing with OOM kills, prompting a detailed investigation that uncovered memory spikes caused by aggressive batch processing, oversized protobuf payloads, and insufficient memory‑pool management, leading to a custom core‑dump solution and several mitigation strategies.
This article details a step‑by‑step investigation of an OutOfMemoryError in a Spring Boot social app, revealing that frequent initialization of a script engine caused massive StringSequence instances via SPI loading, and shows how consolidating the engine eliminated the OOM issue.
This guide analyzes common Spark Out‑Of‑Memory scenarios—such as massive data volumes, data skew, and improper resource allocation—and provides step‑by‑step configurations, memory‑management tweaks, partitioning strategies, and shuffle optimizations to prevent OOM failures in production.
The article analyzes a production out‑of‑memory crash triggered by a pagination bug that misused the OFFSET parameter, explains why the error escaped testing and code review, and presents corrected pagination techniques for Oracle, MySQL and MyBatis to prevent similar failures.
This article explains how SpringBoot interceptors work, demonstrates custom interceptor implementation, shows how misuse of ThreadLocal can cause memory leaks and OOM errors, and provides a fix by moving cleanup logic to afterCompletion, complete with code samples and performance screenshots.
This article outlines practical troubleshooting steps for eight frequent production problems—including OOM, CPU spikes, interface timeouts, index failures, deadlocks, disk issues, MQ backlogs, and API errors—providing clear guidance and code snippets to help engineers quickly identify root causes and resolve them.
This article explains MyBatis dynamic SQL, recounts a first‑hand OOM incident caused by missing backend validation, and shares practical lessons on parameter checking, balancing reusable versus specialized interfaces, and adopting defensive programming to build more reliable backend systems.
This article explores MyBatis dynamic SQL, shares a real OOM incident caused by missing backend validation, and offers practical tips on parameter checking, balancing reusable and specialized interfaces, and adopting defensive programming to build more reliable Java backend services.
This article explains OTA update mechanisms, analyzes why over‑the‑air upgrades cause frequent device reboots due to OOM‑killer and memory fragmentation, and provides concrete steps to disable panic_on_oom and adjust CMA settings to prevent crashes.
This article explains common causes of Java OutOfMemoryError, demonstrates how to reproduce OOM with sample code, and provides step‑by‑step techniques using jmap, heap dumps, and VisualVM to locate and avoid memory leaks in backend applications.
Over the past six months we tackled severe Android memory issues—high OOM crash rates, memory leaks, and large object usage—by implementing systematic profiling, targeted page optimizations, Java and native leak detection tools, and robust monitoring mechanisms, ultimately reducing OOM crashes from 0.8‰ to 0.01‰ and improving app stability.
This article analyzes a MySQL replica that repeatedly ran out of memory due to large triggers and a high table_open_cache_instances setting, demonstrates how to reproduce the issue with test scripts, and provides a practical fix by reducing the parameter to mitigate OOM.
When a Kubernetes pod repeatedly restarts, you can pinpoint the cause by inspecting events, describing the pod, and checking previous logs, then identify OOM kills caused by memory limits in the deployment.yaml and resolve it by increasing the memory limit and redeploying the pod.
This article analyzes a MySQL 5.7 OOM incident triggered by a heavy full‑text query, examines memory usage patterns with Tcmalloc, demonstrates how switching to Jemalloc releases memory, and provides step‑by‑step commands and observations to prevent similar outages.
This article explains how Android malicious anti‑kill techniques exploit foreground services to keep processes alive, outlines the Low Memory Killer mechanism, details process priority values, presents real CVE examples, and offers mitigation strategies for developers and security researchers.
This article examines the frequent OutOfMemoryError incidents in a Java backend service, explains the underlying heap and metaspace causes, analyzes MyBatis source code that leads to memory leaks, demonstrates a reproducible scenario, and offers practical optimization recommendations to prevent OOM in production.
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.
The iQIYI backend team traced random OOM crashes in PyTorch Distributed Data Parallel on an A100 cluster to a malformed DDP message injected by a security scan, which forced a near‑terabyte allocation; using jemalloc for diagnostics, they mitigated the issue by adjusting scan policies and collaborating with PyTorch to harden the protocol.
This article details a real-world Kubernetes control‑plane outage where kube‑apiserver repeatedly OOM‑killed, explores cluster metrics, logs, heap and goroutine profiles, hypothesizes root causes such as etcd latency and DeleteCollection memory leaks, and offers step‑by‑step troubleshooting and prevention guidance.
This guide explains why Java services in containers suffer OOM issues when the JVM heap is mis‑configured, and provides recommended JVM flags, parameter explanations, common FAQs, and tuning tips to reliably limit heap usage and avoid unexpected container restarts.
This article details a comprehensive investigation of an out‑of‑memory crash in a critical Elasticsearch cluster, explains how GC logs and heap dumps revealed a to‑space‑exhausted condition, and describes the G1GC tuning parameters that eliminated the nightly spikes and stabilized performance.
This article explains how a Java application's memory usage can cause Kubernetes pod OOM, the role of namespaces and cgroups in container isolation and resource limiting, and practical steps to adjust JVM settings to prevent frequent restarts.
This article walks through a real‑world investigation of a Metaspace Out‑Of‑Memory error in a Java service, detailing how JVM monitoring tools, class‑loader behavior, and hot‑deployment agents contributed to the issue and presenting practical fixes and preventive measures.
This article explains why Kubernetes pods encounter out‑of‑memory errors and CPU throttling, how limits and requests influence resource allocation, and provides practical monitoring techniques using Prometheus and cAdvisor to proactively identify and mitigate these issues before they impact performance or cause pod eviction.
This article details a real‑world Kubernetes control‑plane outage where kube‑apiserver repeatedly OOM‑killed, examines cluster metrics, logs, heap and goroutine profiles, explores root‑cause hypotheses such as etcd latency and DeleteCollection memory leaks, and offers practical prevention steps.
The NetEase Cloud Music Android team built a comprehensive memory‑monitoring system—combining LeakCanary and KOOM for leak detection, instrumented image loading for large‑bitmap tracking, periodic heap and thread metrics collection, and automated ticket generation—to identify, rank, and resolve leaks, oversized resources, and thread‑related OOM risks across development and production.
This article explains why allocating 8 GB of memory on a 4 GB Linux system can succeed or fail depending on the OS bitness, the overcommit_memory setting, and whether swap is enabled, illustrated with C code experiments, virtual‑memory diagrams, and detailed analysis of OOM handling.
This article examines typical MySQL out‑of‑memory (OOM) situations in production, explains how to diagnose memory usage with Performance Schema and other tools, and presents a series of TDSQL‑C‑specific optimization techniques—including server‑parameter tuning, process‑list monitoring, cold‑page detection, buffer‑pool limits, and dynamic resizing—to mitigate OOM risks.
This article details how long JVM garbage‑collection pauses and glibc ptmalloc memory‑fragmentation caused container OOM kills in a hotel‑pricing system, and explains the step‑by‑step diagnosis, JVM tuning, Kubernetes health‑check adjustments, and the replacement of ptmalloc with jemalloc to eliminate the issue.
This article examines the MemoryLimitedLBQ and MemorySafeLBQ implementations, explains how they use memory‑limiting techniques to avoid Out‑Of‑Memory errors in unbounded LinkedBlockingQueue‑based thread pools, compares their designs, and shows practical code snippets for integrating them into Java projects.
This article explains why Java applications running in Kubernetes can encounter Out‑Of‑Memory errors despite heap usage staying under the Xmx limit, by examining container resource limits, JVM memory models, cgroup behavior, and provides practical configuration recommendations to prevent OOM.
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.
On September 10 2021, a Kubernetes cluster experienced intermittent kubectl hangs caused by kube-apiserver OOM kills, leading to cascading control-plane failures; this article details the environment, observed metrics, log analysis, code inspection of DeleteCollection, and provides troubleshooting steps to prevent similar incidents.
This article walks through a real‑world OOM incident in an MQ consumer caused by large Excel import/export, explains how memory dumps and Prometheus logs pinpointed the culprit, and shows how switching from XSSFWorkbook to SXSSFWorkbook and tuning the thread pool resolved the issue.
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.
This article explains the iOS system architecture, how Mach and BSD layers handle exceptions, the mechanisms for collecting crashes with KSCrash, strategies for OOM detection and monitoring, and techniques for memory snapshotting and reference‑graph analysis to pinpoint memory bloat.
This article analyzes a September 2021 incident where a Kubernetes cluster’s kube-apiserver repeatedly OOM-killed, causing kubectl hangs, by examining cluster specs, monitoring data, logs, heap and goroutine profiles, and the DeleteCollection implementation, ultimately offering troubleshooting steps and preventive measures for control-plane stability.
The article explains how to decide between a CPU‑saturated but memory‑free node and a memory‑saturated but CPU‑free node when scheduling a new Kubernetes pod, arguing that the node with ample memory (CPU‑busy) is generally preferable and describing the underlying kube‑scheduler considerations.
This article analyzes a production outage caused by misuse of ExecutorCompletionService, explains the underlying Java concurrency mechanisms, compares it with ExecutorService, provides correct code examples, and offers practical guidelines to avoid memory leaks and improve backend reliability.
The article explains how requesting memory larger than physical RAM interacts with virtual memory, page faults, swap mechanisms, and OOM handling on 32‑bit and 64‑bit operating systems, illustrated with C code experiments and Linux/macOS observations.
Baidu’s iOS solution monitors single memory allocations exceeding an 8 MB threshold by intercepting malloc_logger and capturing stack traces with backtrace, merging online user‑scenario data and offline pipelines to identify large‑allocation hotspots, reduce OOM crashes, and give developers actionable debugging insight.
A low‑overhead monitoring solution for iOS apps resets the global malloc_logger to capture every allocation, filters large allocations exceeding a configurable threshold, records lightweight stack traces using dyld image maps, and sends address‑only data for offline symbolication, enabling developers to identify and fix memory‑heavy code, reducing OOM crashes.
The article explains how submitting tasks to ExecutorCompletionService without retrieving their results causes the internal unbounded LinkedBlockingQueue to retain Future objects, leading to memory leaks and OutOfMemoryError, and demonstrates the correct usage patterns to prevent this issue.
The article explains how AsyncAppender uses a BlockingQueue with a default size of 256, how an oversized queue can cause OOM, how the discardingThreshold can lead to loss of TRACE/DEBUG/INFO logs, and provides configuration tips such as adjusting queueSize, setting discardingThreshold to zero, or enabling neverBlock to avoid blocking.
This article provides a comprehensive walkthrough of Linux kernel memory management, covering process address space layout, memory allocation mechanisms, OOM selection criteria, where allocated memory resides, and both manual and automatic memory reclamation techniques, complete with code examples and diagrams.
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 explains the root causes of Out‑Of‑Memory (OOM) crashes on Android, classifies OOM types, and provides practical, non‑intrusive solutions for thread‑count, file‑descriptor, and heap‑memory problems, along with monitoring techniques using thread pools, image compression, LeakCanary, KOOM and native hooks.
The article narrates how a developer diagnosed and resolved an Android OOM crash caused by a memory leak in the Coil image loading library, using Android Studio Profiler to trace native bitmap allocations and applying a library fix to prevent view‑detach related leaks.
The article explains why creating Java thread pools with the Executors factory methods can lead to unbounded queues and OOM, and demonstrates how to safely construct thread pools using ThreadPoolExecutor by configuring its seven key parameters.
This article demonstrates how to use Eclipse Memory Analyzer (MAT) together with heap dump files to diagnose Java OutOfMemoryError issues, covering heap dump generation, histogram and dominator tree analysis, reference chain inspection, OQL queries, and a concrete Spring Boot example.
This article details the systematic approach Kuaishou’s video editing app took to define, reproduce, analyze, and resolve iOS out‑of‑memory (OOM) crashes, leveraging edit‑context capture, action tracking, memory profiling, and targeted optimizations that reduced OOM incidents by over 80%.
After moving IoT services to Kubernetes, containers were OOM‑killed despite RSS staying below limits because Kubernetes bases OOM decisions on the Working Set Size (WSS) metric, which includes file cache, and the article explains its calculation, reproduces the issue, and offers practical mitigation strategies.
This article explains Spark's memory model, identifies common driver and executor OOM scenarios, and provides detailed configuration and code‑level recommendations—including memory‑related parameters and shuffle‑tuning options—to prevent and resolve out‑of‑memory failures in Spark applications.
This article explains how Linux manages process memory, covering allocation via mmap and brk, OOM killer selection, the role of page cache in different mapping types, manual and automatic memory reclamation, and related kernel parameters.
This article explains how resource overflow such as memory out‑of‑memory (OOM) and file‑descriptor (FD) exhaustion occurs in Android applications, demonstrates how to identify the root causes using MARS‑APM (APMPlus), and provides practical steps to resolve these crashes.
This article explains why Android memory optimization is needed, introduces background concepts such as garbage collection and memory leaks, reviews common tools like Memory Profiler, MAT and LeakCanary, details image‑related memory reduction techniques, and presents the open‑source KOOM framework for online OOM detection and analysis.
This article explains how Linux allocates memory for a process, the role of OOM when memory runs out, where different types of memory reside, the behavior of shared and private mappings, tmpfs usage, and both manual and automatic memory reclamation mechanisms.
This article explains Linux kernel memory management by covering process address space layout, allocation mechanisms, OOM killer behavior, overcommit settings, various types of file and anonymous mappings, tmpfs usage, and both manual and automatic memory reclamation techniques.
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 the purpose and design of Java thread pools, illustrates common pitfalls such as unbounded queues causing OutOfMemoryError, and provides practical guidelines for configuring bounded queues, naming threads, handling exceptions, choosing rejection policies, and using separate pools for compute‑intensive tasks.
This article explains why Redis can report out‑of‑memory (OOM) errors even with small datasets, describes the two types of OOM, outlines memory‑consumption categories, presents systematic troubleshooting methods, and provides a collection of useful Redis commands for diagnosing and resolving memory‑related issues.
This article investigates why MySQL encounters out‑of‑memory errors during sysbench stress testing with high concurrency, examines system memory metrics, explains Linux vm.overcommit_memory settings, and provides a practical solution to prevent OOM by adjusting kernel parameters.
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 guide explains how to identify OutOfMemoryError crashes in Android applications caused by excessive thread‑pool creation, using tools like Android CPU Profiler, adb ps commands, and code hooks, and provides concrete steps to refactor OkHttp, RxJava, and SDK usage to prevent resource leaks.
A detailed post explains how a mis‑configured HttpClient caused thread explosion and OOM on four servers, walks through the investigation using APM metrics, clarifies keep‑alive mechanics, and presents the fix of using a singleton HttpClient with proper connection eviction.
This guide details how to diagnose and fix the OutOfMemoryError triggered by InMemoryReporterMetrics in a Spring Cloud Sleuth Zipkin setup, covering environment description, step‑by‑step investigation, heap dump analysis, and the final solution of upgrading the zipkin‑reporter dependency.
Tracing a large method with Arthas caused a Metaspace OOM because constant‑pool rewrites inflated the Non‑Class space, each rewrite copying a massive StackMapTable, but preserving the original constant‑pool layout in Arthas stops the growth, and exposing off‑heap metrics aids production monitoring.
Tailor is an open‑source Android memory‑snapshot trimming and compression tool developed by the Xigua Video team that dramatically reduces OOM occurrences by over 95% through efficient snapshot cropping, zlib compression, and seamless integration with the dump process, while preserving essential debugging information.