Tag

MemoryLeak

0 views collected around this technical thread.

Selected Java Interview Questions
Selected Java Interview Questions
Feb 16, 2025 · Backend Development

Understanding ThreadLocal Implementation and Memory Leak Issues in Java

This article explains how ThreadLocal stores values per thread, details the internal set and get mechanisms, discusses potential memory‑leak problems caused by stale entries, and provides best‑practice guidelines such as using remove() and InheritableThreadLocal for child threads.

InheritableThreadLocalJavaMemoryLeak
0 likes · 9 min read
Understanding ThreadLocal Implementation and Memory Leak Issues in Java
DaTaobao Tech
DaTaobao Tech
Dec 11, 2024 · Backend Development

Resolving Metaspace and Off‑Heap Memory Issues After JDK 11 Upgrade

After upgrading core services to JDK 11, the team encountered a Metaspace rise and off‑heap memory growth caused by class‑loading changes and Netty’s disabled native buffers, which were resolved by expanding Metaspace to 768 MB and adding JVM options to enable Netty reflection and open required modules, restoring normal memory usage.

JDK11JVMMemoryLeak
0 likes · 8 min read
Resolving Metaspace and Off‑Heap Memory Issues After JDK 11 Upgrade
macrozheng
macrozheng
Nov 27, 2024 · Backend Development

How a Tiny HashMap Bug Triggered a Massive Memory Leak in a High‑Traffic Microservice

A senior architect introduced a high‑concurrency monitoring feature that used a ConcurrentHashMap without proper equals/hashCode implementations, leading to duplicate keys, race conditions, and severe memory leaks, which were later resolved by correcting the key class and applying atomic map operations.

ConcurrentHashMapHashCodeJava
0 likes · 8 min read
How a Tiny HashMap Bug Triggered a Massive Memory Leak in a High‑Traffic Microservice
Zhuanzhuan Tech
Zhuanzhuan Tech
Mar 27, 2024 · Backend Development

Investigation and Resolution of High Container Memory Usage in a Java G1GC Application

This article details a step‑by‑step investigation of a container whose memory usage spiked to 99% due to large objects being allocated to the old generation under G1GC, explains the root cause, demonstrates reproducible tests with JVM flags and monitoring tools, and provides practical mitigation strategies.

DockerFullGCG1GC
0 likes · 15 min read
Investigation and Resolution of High Container Memory Usage in a Java G1GC Application
Java Architect Essentials
Java Architect Essentials
Mar 4, 2024 · Fundamentals

Anonymous Inner Classes vs Lambda Expressions: Memory Leak Risks in Java

This article examines how anonymous inner classes and lambda expressions differ in their handling of outer class references, analyzes compiled bytecode to reveal potential memory leak risks, and demonstrates how explicit references affect lambda behavior in Java Android development.

AndroidAnonymousInnerClassBytecode
0 likes · 9 min read
Anonymous Inner Classes vs Lambda Expressions: Memory Leak Risks in Java
DaTaobao Tech
DaTaobao Tech
Dec 8, 2023 · Backend Development

ZSTD Compression and GC Optimization in Java Netty Backend

Switching a Java Netty gateway from GZIP to ZSTD compression using zstd‑jni doubled GC time and introduced heap and Netty off‑heap memory leaks, which were resolved by employing the library’s direct off‑heap API with a NoFinalizer compressor, promptly releasing ByteBufs, avoiding finalize(), and adopting jemalloc to reduce fragmentation.

GCJavaMemoryLeak
0 likes · 19 min read
ZSTD Compression and GC Optimization in Java Netty Backend
vivo Internet Technology
vivo Internet Technology
Oct 18, 2023 · Backend Development

Understanding JDK ThreadLocal and Netty FastThreadLocal: Implementation, Advantages, and Best Practices

The article compares JDK ThreadLocal and Netty FastThreadLocal, detailing their implementations, performance trade‑offs, and memory‑leak risks, illustrates a real‑world HTTPS bug caused by missing remove() calls, and recommends always cleaning up ThreadLocal values while noting FastThreadLocal’s O(1) access may not always outperform the JDK version.

JavaMemoryLeakNetty
0 likes · 17 min read
Understanding JDK ThreadLocal and Netty FastThreadLocal: Implementation, Advantages, and Best Practices
JD Retail Technology
JD Retail Technology
Sep 14, 2023 · Backend Development

Root Cause Analysis of Memory Leak and High Latency in a Netty‑Based Real‑Time Risk Control System Using JDK 17 ZGC

This article investigates the severe memory growth and latency spikes observed when synchronizing data across data centers in a Netty‑driven online computation service, analyzes the impact of JDK 17 ZGC and direct‑buffer allocation, and presents the debugging steps, source‑code insights, and configuration changes that ultimately resolved the issue.

DirectMemoryJavaMemoryLeak
0 likes · 13 min read
Root Cause Analysis of Memory Leak and High Latency in a Netty‑Based Real‑Time Risk Control System Using JDK 17 ZGC
政采云技术
政采云技术
Aug 31, 2023 · Backend Development

Understanding Java ThreadLocal: Principles, Implementation, and Best Practices

ThreadLocal provides each Java thread with its own isolated variable copy, and this article explains its underlying mechanism, core methods (set, get, remove), internal ThreadLocalMap structure, practical code examples, common usage scenarios, and important considerations such as memory leaks and proper cleanup.

JavaMemoryLeakThreadLocalMap
0 likes · 12 min read
Understanding Java ThreadLocal: Principles, Implementation, and Best Practices
Selected Java Interview Questions
Selected Java Interview Questions
Jul 24, 2023 · Backend Development

Analyzing and Reproducing OutOfMemoryError Caused by MyBatis and DruidDataSource in a Java Backend Service

This article investigates the root causes of frequent OutOfMemoryError incidents in a distributed Java backend, explains how MyBatis and DruidDataSource can exhaust heap and metaspace, demonstrates a reproducible test with JVM options and multithreading, and offers practical mitigation strategies.

DockerJavaMemoryLeak
0 likes · 7 min read
Analyzing and Reproducing OutOfMemoryError Caused by MyBatis and DruidDataSource in a Java Backend Service
DaTaobao Tech
DaTaobao Tech
Jun 28, 2023 · Backend Development

Debugging V8FatalErrorCallback OOM Crashes in Electron Live Streaming Client

The article details how the author traced V8FatalErrorCallback out‑of‑memory crashes in an Electron‑based Taobao Live client to an ever‑growing compilation cache and pointer‑compression limits, rebuilt Electron with those disabled, identified a JavaScript memory leak caused by unfiltered error logging, and implemented runtime heap monitoring to prevent future OOM failures.

ChromeDevToolsElectronMemoryLeak
0 likes · 35 min read
Debugging V8FatalErrorCallback OOM Crashes in Electron Live Streaming Client
Cognitive Technology Team
Cognitive Technology Team
Oct 15, 2022 · Fundamentals

Analysis of Java ThreadLocal Implementation and Usage Pitfalls

This article explains the internal workings of Java's ThreadLocal, including the ThreadLocalMap structure, weak reference handling, lazy initialization, and common pitfalls such as memory leaks in thread pools, and provides best‑practice guidelines for safe usage.

BestPracticesJavaMemoryLeak
0 likes · 7 min read
Analysis of Java ThreadLocal Implementation and Usage Pitfalls
Zhuanzhuan Tech
Zhuanzhuan Tech
Aug 10, 2022 · Backend Development

Investigation and Resolution of Full GC Alerts Caused by Groovy Script Execution in a Java Service

The report analyzes recurring morning Full GC alerts in a Java service, identifies a Groovy‑driven scheduled task as the root cause through JVM parameter review, log inspection, and memory profiling, and proposes concrete fixes such as reusing a single GroovyShell instance and clearing its classloader cache.

FullGCGroovyJVM
0 likes · 8 min read
Investigation and Resolution of Full GC Alerts Caused by Groovy Script Execution in a Java Service
Cognitive Technology Team
Cognitive Technology Team
Jul 9, 2022 · Backend Development

Avoiding OOM When Using java.util.concurrent.ExecutorCompletionService

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.

ExecutorCompletionServiceJavaMemoryLeak
0 likes · 6 min read
Avoiding OOM When Using java.util.concurrent.ExecutorCompletionService
Top Architect
Top Architect
May 10, 2022 · Mobile Development

Comprehensive Guide to OOM Issues, Thread Optimization, and Memory Leak Monitoring in Android Apps

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.

AndroidMemoryLeakMobileDev
0 likes · 23 min read
Comprehensive Guide to OOM Issues, Thread Optimization, and Memory Leak Monitoring in Android Apps
Cognitive Technology Team
Cognitive Technology Team
Apr 24, 2022 · Backend Development

Pitfalls of Using ThreadLocal for User Context in Java Applications

Using ThreadLocal to store user information in Java web applications can lead to hidden failures such as loss of context and memory leaks, especially when thread pools are involved, so developers should restrict its usage to controller threads and employ static analysis tools to detect improper usage.

JavaMemoryLeakconcurrency
0 likes · 4 min read
Pitfalls of Using ThreadLocal for User Context in Java Applications
360 Quality & Efficiency
360 Quality & Efficiency
Dec 31, 2021 · Backend Development

Understanding and Troubleshooting Out‑of‑Memory Issues in Java Applications

This article explains the causes of Java out‑of‑memory problems, introduces essential diagnostic commands and memory‑analysis tools, and walks through a real‑world case study that shows how to locate, analyze, and fix a memory leak caused by unreleased OSS client connections.

JVMJavaMemoryLeak
0 likes · 7 min read
Understanding and Troubleshooting Out‑of‑Memory Issues in Java Applications
Sohu Tech Products
Sohu Tech Products
Aug 5, 2020 · Backend Development

Debugging and Fixing the ConcurrentLinkedQueue Memory Leak Bug in JDK8

This article explains the root cause of a memory‑leak bug in JDK8's ConcurrentLinkedQueue, demonstrates how to reproduce and visualize the issue with custom CLQ implementations, analyzes the removal algorithm, and shares practical debugging tips including a notorious IDEA debug pitfall and its resolution.

ConcurrentLinkedQueueJDK8Java
0 likes · 14 min read
Debugging and Fixing the ConcurrentLinkedQueue Memory Leak Bug in JDK8
Sohu Tech Products
Sohu Tech Products
Aug 5, 2020 · Backend Development

Analyzing a JDK ConcurrentLinkedQueue Memory Leak Bug in Jetty's QueuedThreadPool

This article examines a JDK bug causing memory leaks in Jetty's QueuedThreadPool due to improper removal in ConcurrentLinkedQueue, demonstrates the issue with a long‑running demo, analyzes heap growth using jconsole, VisualVM and jmc, and shows how newer JDK versions fix the problem.

ConcurrentLinkedQueueJDKJava
0 likes · 14 min read
Analyzing a JDK ConcurrentLinkedQueue Memory Leak Bug in Jetty's QueuedThreadPool