Tagged articles
82 articles
Page 1 of 1
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Apr 20, 2026 · Backend Development

Avoid Hidden Thread‑Safety Bugs in Spring Boot 3: 6 Common Pitfalls and Fixes

This article examines six typical concurrency mistakes in Spring Boot 3—misusing volatile, unsafe ConcurrentHashMap patterns, exposing mutable collections, removing synchronized, abusing parallel streams, and invisible shutdown flags—showing why they occur and providing concrete, thread‑safe code replacements.

ConcurrentHashMapSpring Bootatomic
0 likes · 9 min read
Avoid Hidden Thread‑Safety Bugs in Spring Boot 3: 6 Common Pitfalls and Fixes
macrozheng
macrozheng
Apr 12, 2026 · Backend Development

Why a Simple HashMap Bug Crashed Our High‑Concurrency Service and How to Fix It

A senior architect introduced a high‑concurrency monitoring feature that used ConcurrentHashMap, but missing equals/hashCode and non‑atomic updates caused massive memory leaks and race conditions, leading to a post‑mortem that highlights proper key implementation, atomic map operations, and cautious synchronization.

ConcurrentHashMapMemoryLeakconcurrency
0 likes · 7 min read
Why a Simple HashMap Bug Crashed Our High‑Concurrency Service and How to Fix It
IT Services Circle
IT Services Circle
Mar 1, 2026 · Interview Experience

Li Auto Java Campus Interview Guide: Salary Insights and Core Java Q&A

This article combines Li Auto's 2026 campus recruitment salary data—showing typical offers ranging from 25k to 32k monthly with 14‑16 month packages—and a comprehensive Java interview cheat‑sheet covering inheritance vs interfaces, Map implementations, String handling, ConcurrentHashMap internals, reference types, memory‑leak detection, design patterns, observer pattern, multithreading, Future execution, and deadlock prevention.

ConcurrentHashMapLi Autointerview
0 likes · 27 min read
Li Auto Java Campus Interview Guide: Salary Insights and Core Java Q&A
JakartaEE China Community
JakartaEE China Community
Oct 20, 2025 · Fundamentals

How to Prevent ConcurrentModificationException in Java Collections

The article explains why ConcurrentModificationException occurs when a Java collection is structurally modified during iteration, illustrates typical scenarios such as enhanced‑for loops and multithreaded access, and provides practical solutions including iterator.remove(), thread‑safe collections, synchronized blocks and iterating over copies.

CollectionsConcurrentHashMapConcurrentModificationException
0 likes · 7 min read
How to Prevent ConcurrentModificationException in Java Collections
Programmer Null's Self-Cultivation
Programmer Null's Self-Cultivation
Jul 13, 2025 · Backend Development

Unlocking the Secrets of Java’s ConcurrentHashMap: From JDK 7 to JDK 8

This article provides a comprehensive, step‑by‑step analysis of Java's ConcurrentHashMap, covering its evolution from JDK 7’s segment‑lock design to JDK 8’s bucket‑level CAS and synchronized approach, complete with macro diagrams, microscopic source‑code walkthroughs, hash calculations, resizing mechanisms, and practical usage tips.

ConcurrentHashMapHashMapJDK7
0 likes · 16 min read
Unlocking the Secrets of Java’s ConcurrentHashMap: From JDK 7 to JDK 8
Java Tech Enthusiast
Java Tech Enthusiast
Jun 28, 2025 · Backend Development

Mastering Java Interviews: HashMap, ConcurrentHashMap, JVM GC, and SQL Tricks

This article shares a real HSBC interview experience and provides in‑depth explanations of Java HashMap internals, ConcurrentHashMap locking mechanisms, differences between synchronized and ReentrantLock, JVM garbage‑collection nuances, memory‑overflow causes, and practical SQL queries for extracting top scores.

ConcurrentHashMapHashMapJVM
0 likes · 13 min read
Mastering Java Interviews: HashMap, ConcurrentHashMap, JVM GC, and SQL Tricks
JD Tech Talk
JD Tech Talk
May 19, 2025 · Backend Development

Detailed Explanation of Java ConcurrentHashMap Source Code: Constructors, put, get, resize, and Concurrency Mechanisms

This article provides an in‑depth analysis of the Java ConcurrentHashMap implementation, covering its constructor logic, hash‑table sizing, the core put and get operations, element counting with addCount, multi‑threaded resizing via transfer, treeification of bins, removal, computeIfAbsent, and the design choices that forbid null keys and values to simplify concurrency handling.

CASConcurrentHashMaphash table
0 likes · 36 min read
Detailed Explanation of Java ConcurrentHashMap Source Code: Constructors, put, get, resize, and Concurrency Mechanisms
JD Cloud Developers
JD Cloud Developers
May 19, 2025 · Backend Development

Unlocking Java’s ConcurrentHashMap: Inside Constructors, Put, and Resizing

This article provides a thorough, English‑language walkthrough of Java 8+ ConcurrentHashMap’s source code, covering its constructor logic, load‑factor handling, CAS‑based insertion, node optimizations, the put method, element‑count updates, multi‑threaded resizing, treeification, and auxiliary operations such as get, remove, and computeIfAbsent.

ConcurrentHashMapData Structuresconcurrency
0 likes · 42 min read
Unlocking Java’s ConcurrentHashMap: Inside Constructors, Put, and Resizing
Cognitive Technology Team
Cognitive Technology Team
May 5, 2025 · Fundamentals

Evolution of Java ConcurrentHashMap: From Segment Locks to CAS + synchronized (Java 7 vs Java 8)

This article examines the evolution of Java's ConcurrentHashMap, comparing the segment‑lock implementation in Java 7 with the CAS‑plus‑synchronized, bucket‑level locking and red‑black tree enhancements introduced in Java 8, covering lock mechanisms, data structures, resizing strategies, core operations, performance and suitable use cases.

ConcurrentHashMapDataStructureconcurrency
0 likes · 11 min read
Evolution of Java ConcurrentHashMap: From Segment Locks to CAS + synchronized (Java 7 vs Java 8)
Sanyou's Java Diary
Sanyou's Java Diary
Apr 24, 2025 · Fundamentals

Master Java’s Concurrent Containers: Deep Dive into ConcurrentHashMap and Queues

This article provides an in‑depth exploration of Java’s concurrent collection classes, covering the design and implementation of ConcurrentHashMap, ConcurrentLinkedQueue, and the seven blocking queue variants, complete with code analysis, performance considerations, and practical usage scenarios for high‑throughput multithreaded applications.

BlockingQueueConcurrentHashMapConcurrentLinkedQueue
0 likes · 50 min read
Master Java’s Concurrent Containers: Deep Dive into ConcurrentHashMap and Queues
Sanyou's Java Diary
Sanyou's Java Diary
Apr 21, 2025 · Fundamentals

Is Java's ConcurrentHashMap Strongly Consistent? Unveiling the Truth

This article explains the difference between strong and weak consistency, explores Java's memory model, visibility and ordering issues, and shows how Java 8 redesigns ConcurrentHashMap with CAS and Unsafe to achieve strong consistency for put and get operations.

ConcurrentHashMapConsistencyMemory Model
0 likes · 15 min read
Is Java's ConcurrentHashMap Strongly Consistent? Unveiling the Truth
Java Tech Enthusiast
Java Tech Enthusiast
Mar 4, 2025 · Backend Development

When to Use volatile with ConcurrentHashMap and Spring Bean Thread Safety

A ConcurrentHashMap is internally thread‑safe, so a volatile declaration is only required when its reference may be reassigned (or the field is final), while Spring singleton beans with mutable fields are not thread‑safe and should be made stateless, prototype‑scoped, or synchronized for composite operations.

ConcurrentHashMapjavaspring
0 likes · 13 min read
When to Use volatile with ConcurrentHashMap and Spring Bean Thread Safety
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Jan 21, 2025 · Backend Development

Mastering ConcurrentHashMap: Build High‑Performance Caches in Spring Boot 3

This article explains why ConcurrentHashMap is ideal for high‑concurrency caching, outlines its key features, and provides step‑by‑step Java examples—including a basic in‑memory cache, an expiring cache, and an auto‑loading cache—plus a recommendation to use Caffeine for production workloads.

ConcurrentHashMapSpring Bootbackend-development
0 likes · 11 min read
Mastering ConcurrentHashMap: Build High‑Performance Caches in Spring Boot 3
Java Backend Technology
Java Backend Technology
Dec 5, 2024 · Backend Development

Why a Simple HashMap Bug Caused Massive Memory Leaks in High‑Concurrency Java Services

An overconfident architect introduced a high‑traffic monitoring feature using ConcurrentHashMap without proper equals/hashCode overrides, causing millions of duplicate keys, memory leaks, and crashes; the team debated synchronized versus putIfAbsent solutions, ultimately fixing the bug and highlighting essential concurrency and code‑review practices for Java back‑end development.

CodeReviewConcurrentHashMapMemoryLeak
0 likes · 7 min read
Why a Simple HashMap Bug Caused Massive Memory Leaks in High‑Concurrency Java Services
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.

ConcurrentHashMapMemoryLeakSynchronization
0 likes · 8 min read
How a Tiny HashMap Bug Triggered a Massive Memory Leak in a High‑Traffic Microservice
Architect
Architect
Oct 21, 2024 · Backend Development

Choosing the Right Local Cache in Java: From ConcurrentHashMap to Caffeine

This article examines why and how to use local in‑process caches in Java, compares four implementations—ConcurrentHashMap, Guava Cache, Caffeine, and Ehcache—covers essential cache features, consistency challenges, hit‑rate optimization, and recommends Caffeine as the most performant choice for a two‑level caching architecture.

Cache ConsistencyCaffeineConcurrentHashMap
0 likes · 11 min read
Choosing the Right Local Cache in Java: From ConcurrentHashMap to Caffeine
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Sep 17, 2024 · Backend Development

In‑Depth Explanation of Java ConcurrentHashMap Core Principles and Source Code

This article provides a comprehensive analysis of Java's ConcurrentHashMap, covering its underlying data structures, key attributes, core components such as Node, ForwardingNode, TreeBin, and TreeNode, and detailed explanations of the put, get, hash, and resizing algorithms with annotated source code examples.

ConcurrentHashMapData StructuresHashMap
0 likes · 17 min read
In‑Depth Explanation of Java ConcurrentHashMap Core Principles and Source Code
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Aug 15, 2024 · Backend Development

Understanding Java ConcurrentHashMap: Principles, Implementation, and Usage

This article provides a comprehensive overview of Java's ConcurrentHashMap, explaining its purpose, underlying lock‑segmentation and CAS mechanisms in JDK 7 and JDK 8, demonstrating usage with sample code, and outlining scenarios where it delivers high‑performance thread‑safe map operations.

ConcurrentHashMapData Structuresbackend-development
0 likes · 6 min read
Understanding Java ConcurrentHashMap: Principles, Implementation, and Usage
Cognitive Technology Team
Cognitive Technology Team
Jun 10, 2024 · Backend Development

Recursive Update Bug in ConcurrentHashMap.computeIfAbsent Causing Infinite Loop and CPU Spike

The article explains a bug in Java's ConcurrentHashMap.computeIfAbsent that can cause recursive updates and infinite loops, leading to CPU spikes, and shows that newer Java versions throw an IllegalStateException while recommending avoiding nested computeIfAbsent/putIfAbsent calls, with a code example.

BackendConcurrentHashMapbug
0 likes · 3 min read
Recursive Update Bug in ConcurrentHashMap.computeIfAbsent Causing Infinite Loop and CPU Spike
Cognitive Technology Team
Cognitive Technology Team
Jun 8, 2024 · Fundamentals

Why ConcurrentHashMap Disallows Null Keys and Values in Java

ConcurrentHashMap forbids null keys and values because allowing nulls creates ambiguous results in concurrent environments, making it impossible to distinguish between a missing entry and an entry explicitly mapped to null, which could compromise thread safety, as explained by Doug Lea’s design rationale.

ConcurrentHashMapNULLjava
0 likes · 4 min read
Why ConcurrentHashMap Disallows Null Keys and Values in Java
Su San Talks Tech
Su San Talks Tech
Oct 30, 2023 · Backend Development

Boost Backend Performance with HashMap, LinkedHashMap, TreeMap & ByteBuffer

This article explores four powerful yet understated caching techniques—HashMap with read‑write locks, LinkedHashMap‑based LRU caches, TreeMap for consistent hashing, and ByteBuffer pooling—detailing their implementations in middleware such as RocketMQ, MyBatis, and Cobar to enhance backend performance.

ByteBufferConcurrentHashMapHashMap
0 likes · 10 min read
Boost Backend Performance with HashMap, LinkedHashMap, TreeMap & ByteBuffer
Selected Java Interview Questions
Selected Java Interview Questions
May 5, 2023 · Backend Development

High‑Frequency Java Concurrency Questions: AQS, Locks, Thread Pools, Blocking Queues, CountDownLatch, Semaphore, CopyOnWriteArrayList, and ConcurrentHashMap

This article explains the core concepts and common pitfalls of Java's AbstractQueuedSynchronizer (AQS) and its derived utilities such as ReentrantLock, ReentrantReadWriteLock, CountDownLatch, Semaphore, as well as the design and behavior of blocking queues, thread‑pool parameters, CopyOnWriteArrayList, and ConcurrentHashMap, providing code examples and practical guidance.

AQSBlockingQueueConcurrentHashMap
0 likes · 21 min read
High‑Frequency Java Concurrency Questions: AQS, Locks, Thread Pools, Blocking Queues, CountDownLatch, Semaphore, CopyOnWriteArrayList, and ConcurrentHashMap
Java Interview Crash Guide
Java Interview Crash Guide
Apr 13, 2023 · Backend Development

Inside ConcurrentHashMap: Architecture, Features, and Performance Tricks

This article explains the internal structure of Java's ConcurrentHashMap in JDK 1.8, covering its array‑based storage, linked‑list and red‑black tree handling of hash collisions, core concurrency mechanisms, and key performance enhancements such as fine‑grained locking, lock‑free size updates, and multithreaded resizing.

ConcurrentHashMapData Structuresjava
0 likes · 4 min read
Inside ConcurrentHashMap: Architecture, Features, and Performance Tricks
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Dec 19, 2022 · Backend Development

Understanding the Implementation of Java ConcurrentHashMap (Differences Between JDK 1.7 and JDK 1.8)

This article explains the internal design of Java's ConcurrentHashMap, covering hash table fundamentals, contrasts with HashMap and Hashtable, and details the architectural changes from the segment‑based locking in JDK 1.7 to the node‑based, CAS‑driven structure with tree bins in JDK 1.8.

ConcurrentHashMapData StructuresJDK1.7
0 likes · 10 min read
Understanding the Implementation of Java ConcurrentHashMap (Differences Between JDK 1.7 and JDK 1.8)
FunTester
FunTester
Jun 14, 2022 · Backend Development

Why ConcurrentHashMap Slows Down with Hundreds of Threads? A Deep Performance Test

This article presents a detailed benchmark of java.util.concurrent.ConcurrentHashMap under high thread counts, explains the test methodology using a Groovy‑based FunTester framework, shares raw performance numbers, and uncovers that CPU limits and random number generation are the primary bottlenecks.

ConcurrentHashMapThreadLocalRandombenchmark
0 likes · 7 min read
Why ConcurrentHashMap Slows Down with Hundreds of Threads? A Deep Performance Test
Sohu Tech Products
Sohu Tech Products
May 18, 2022 · Fundamentals

Understanding Strong vs. Weak Consistency in Java's ConcurrentHashMap

This article explains the concepts of strong and weak consistency, their roots in visibility and ordering within the Java Memory Model, and how Java 8’s ConcurrentHashMap uses volatile fields, CAS, and unsafe operations to achieve strong consistency for put/get while retaining weak consistency for operations like size().

ConcurrentHashMapConsistencyMemory Model
0 likes · 14 min read
Understanding Strong vs. Weak Consistency in Java's ConcurrentHashMap
Selected Java Interview Questions
Selected Java Interview Questions
Sep 12, 2021 · Backend Development

Understanding Java ConcurrentHashMap: Initialization, Null Handling, Resizing, Data Structure, Operations, and Thread‑Safety

This article explains Java 1.8 ConcurrentHashMap’s default capacity, null‑key/value restrictions, resizing behavior, internal array‑list‑tree structure, node fields, put and get processes, thread‑safety mechanisms, iterator consistency, and differences between JDK 7 and JDK 8 implementations.

ConcurrentHashMapJava 8java
0 likes · 9 min read
Understanding Java ConcurrentHashMap: Initialization, Null Handling, Resizing, Data Structure, Operations, and Thread‑Safety
Programmer DD
Programmer DD
May 21, 2021 · Backend Development

ThreadLocal & ConcurrentHashMap: Hidden Bugs in Java Concurrency

This article examines common misconceptions when using Java concurrency utilities such as ThreadLocal, ConcurrentHashMap, and CopyOnWriteArrayList, demonstrates real‑world bugs caused by thread reuse and improper atomic operations, and provides practical solutions—including explicit cleanup, proper locking, and high‑performance alternatives like computeIfAbsent and LongAdder—to ensure thread‑safe and efficient code.

ConcurrentHashMapCopyOnWriteArrayListThreadLocal
0 likes · 12 min read
ThreadLocal & ConcurrentHashMap: Hidden Bugs in Java Concurrency
Java Backend Technology
Java Backend Technology
Apr 28, 2021 · Backend Development

Unlocking Java 8 ConcurrentHashMap: A Deep Dive into Lock‑Free Scaling and Performance

This article explains how Java 8’s ConcurrentHashMap improves concurrency by replacing segment locks with fine‑grained CAS operations, introduces ForwardingNode for lock‑free resizing, and details the internal algorithms for initialization, put, dynamic expansion, and size counting, complete with code examples.

CASConcurrentHashMapJDK8
0 likes · 28 min read
Unlocking Java 8 ConcurrentHashMap: A Deep Dive into Lock‑Free Scaling and Performance
Top Architect
Top Architect
Apr 6, 2021 · Backend Development

Why ConcurrentHashMap.get() in Java 8 Is Lock‑Free

The article explains how Java 8's ConcurrentHashMap implements a lock‑free get() operation by replacing the Segment design with Node objects, using volatile fields and CAS, and how the volatile‑marked table array ensures visibility during resizing, making reads both safe and efficient.

ConcurrentHashMapbackend-developmentconcurrency
0 likes · 10 min read
Why ConcurrentHashMap.get() in Java 8 Is Lock‑Free
Intelligent Backend & Architecture
Intelligent Backend & Architecture
Apr 2, 2021 · Fundamentals

Master Java Collections: From ArrayList to ConcurrentHashMap Explained

This article provides a comprehensive overview of Java's collection framework, detailing the roles of interfaces, implementations, and algorithms, comparing collections with arrays, describing common List, Set, and Map classes, their underlying data structures, thread‑safety characteristics, and best practices for iteration and usage.

CollectionsConcurrentHashMapData Structures
0 likes · 48 min read
Master Java Collections: From ArrayList to ConcurrentHashMap Explained
Top Architect
Top Architect
Mar 11, 2021 · Fundamentals

Why ConcurrentHashMap.get() in Java 8 Is Lock‑Free

This article explains how Java 8's ConcurrentHashMap implements the get operation without acquiring locks by using volatile fields, CAS, and a simplified node structure, contrasting it with the segment‑based design of JDK 1.7 and detailing the memory‑visibility guarantees provided by volatile.

ConcurrentHashMapJDK8concurrency
0 likes · 9 min read
Why ConcurrentHashMap.get() in Java 8 Is Lock‑Free
Code Ape Tech Column
Code Ape Tech Column
Dec 27, 2020 · Backend Development

Why ThreadLocal and ConcurrentHashMap Can Still Cause Bugs—and How to Fix Them

This article examines common misconceptions about Java concurrency utilities such as ThreadLocal, ConcurrentHashMap, and CopyOnWriteArrayList, demonstrates real‑world bugs caused by thread reuse and non‑atomic operations, and provides concrete solutions and performance‑tested alternatives.

ConcurrentHashMapCopyOnWriteArrayListJava concurrency
0 likes · 12 min read
Why ThreadLocal and ConcurrentHashMap Can Still Cause Bugs—and How to Fix Them
Selected Java Interview Questions
Selected Java Interview Questions
Dec 26, 2020 · Backend Development

Thread Reuse Pitfalls, ThreadLocal Misuse, and Proper Use of ConcurrentHashMap and CopyOnWriteArrayList

This article explains how thread reuse in a Tomcat thread pool can cause user‑information leakage when ThreadLocal is misused, analyzes the non‑atomic behavior of ConcurrentHashMap operations, demonstrates performance differences between locking and atomic methods, and warns against inappropriate use of CopyOnWriteArrayList in high‑write scenarios.

ConcurrentHashMapCopyOnWriteArrayListJava concurrency
0 likes · 13 min read
Thread Reuse Pitfalls, ThreadLocal Misuse, and Proper Use of ConcurrentHashMap and CopyOnWriteArrayList
Java Captain
Java Captain
Dec 10, 2020 · Backend Development

Implementing a Real-Time Network Chatroom in Java Using TCP and Multithreading

This article explains how to build a real‑time network chatroom in Java using TCP sockets, multithreading, and a ConcurrentHashMap to manage user connections, detailing command handling for listing users, group chat, private messages, exiting, and server shutdown, with full source code examples.

ChatroomConcurrentHashMapNetwork programming
0 likes · 14 min read
Implementing a Real-Time Network Chatroom in Java Using TCP and Multithreading
Su San Talks Tech
Su San Talks Tech
Dec 8, 2020 · Backend Development

How Java's ConcurrentHashMap Delivers High‑Performance Thread Safety

This article explains the internal design of Java's ConcurrentHashMap, covering its evolution from JDK7 to JDK8, the segment‑based locking mechanism, lock‑free reads, CAS operations, table resizing, treeification, and the key classes and methods that enable efficient concurrent access while maintaining thread safety.

CASConcurrentHashMapLock Splitting
0 likes · 42 min read
How Java's ConcurrentHashMap Delivers High‑Performance Thread Safety
Architecture Digest
Architecture Digest
Nov 18, 2020 · Backend Development

Deep Dive into Java ConcurrentHashMap: Implementation, Concurrency Mechanisms, and Core Methods

This article provides a comprehensive analysis of Java's ConcurrentHashMap, covering its historical evolution, key internal fields, the thread‑safe put and remove operations, the complex resizing and transfer mechanisms, and auxiliary methods such as size, get, and clear, all illustrated with original source code.

ConcurrentHashMapData StructuresJDK
0 likes · 24 min read
Deep Dive into Java ConcurrentHashMap: Implementation, Concurrency Mechanisms, and Core Methods
Selected Java Interview Questions
Selected Java Interview Questions
Oct 7, 2020 · Fundamentals

In-depth Overview of Java HashMap and ConcurrentHashMap: Structure, Operations, and Performance

This article provides a comprehensive explanation of Java's HashMap and ConcurrentHashMap implementations, covering their internal data structures, hashing mechanisms, load factor, resizing process, collision handling, and the differences between JDK 1.7 and 1.8, along with practical interview questions and code examples.

BackendConcurrentHashMapHashMap
0 likes · 15 min read
In-depth Overview of Java HashMap and ConcurrentHashMap: Structure, Operations, and Performance
vivo Internet Technology
vivo Internet Technology
Sep 16, 2020 · Backend Development

How ConcurrentHashMap Guarantees Thread‑Safe Reads and Writes: A Deep Dive into C13Map Internals

This article explains the fundamentals of HashMap, then dissects the internal fields, node‑array safety, read‑path guarantees, write‑path locking, atomic compute methods, resize‑transfer mechanics, traverser design, and bulk‑task support that together make Java's ConcurrentHashMap (C13Map) a highly concurrent, lock‑free data structure.

ConcurrentHashMapData StructuresHashMap
0 likes · 49 min read
How ConcurrentHashMap Guarantees Thread‑Safe Reads and Writes: A Deep Dive into C13Map Internals
macrozheng
macrozheng
Aug 13, 2020 · Backend Development

Why JDK 8’s computeIfAbsent Can Deadlock: A Deep Dive into the Bug

This article explores a JDK 8 bug in ConcurrentHashMap’s computeIfAbsent method that can cause an infinite loop, explains how the issue was discovered, reproduces it with test code, analyzes the root cause, and shows the fix introduced in JDK 9.

ConcurrentHashMapJDKbug
0 likes · 16 min read
Why JDK 8’s computeIfAbsent Can Deadlock: A Deep Dive into the Bug
Architect's Tech Stack
Architect's Tech Stack
Aug 10, 2020 · Fundamentals

Understanding Java HashMap and ConcurrentHashMap: Structure, Operations, and Performance

This article explains the internal structure of Java's HashMap and ConcurrentHashMap, covering hash calculations, bucket arrays, linked‑list and red‑black tree conversions, load factor and resizing behavior, as well as the differences in concurrency control between JDK 1.7 and 1.8 implementations.

ConcurrentHashMapData StructuresHashMap
0 likes · 13 min read
Understanding Java HashMap and ConcurrentHashMap: Structure, Operations, and Performance
macrozheng
macrozheng
Aug 6, 2020 · Backend Development

When ‘No‑Comment’ Java Code Triggers a Memory Leak – A ConcurrentHashMap Study

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.

ConcurrentHashMapSynchronizationbackend-development
0 likes · 8 min read
When ‘No‑Comment’ Java Code Triggers a Memory Leak – A ConcurrentHashMap Study
Java Backend Technology
Java Backend Technology
Jul 31, 2020 · Backend Development

How a “No‑Comment” Java Code Caused a Massive Memory Leak – Lessons on ConcurrentHashMap

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.

ConcurrentHashMapSynchronizationjava
0 likes · 8 min read
How a “No‑Comment” Java Code Caused a Massive Memory Leak – Lessons on ConcurrentHashMap
Programmer DD
Programmer DD
Jun 2, 2020 · Backend Development

Mastering Java HashMap & ConcurrentHashMap: Internals, Performance, and Best Practices

This article explains the internal structure and working principles of Java's HashMap and ConcurrentHashMap, covering hash calculations, collision handling, resizing, the transition to red‑black trees, differences with TreeMap, LinkedHashMap, Hashtable, and performance‑related lock mechanisms in JDK 7 and JDK 8.

ConcurrentHashMapData StructureHashMap
0 likes · 14 min read
Mastering Java HashMap & ConcurrentHashMap: Internals, Performance, and Best Practices
Programmer DD
Programmer DD
May 26, 2020 · Backend Development

Deep Dive into Java's ConcurrentHashMap: Implementation, Put & Remove Mechanics

This article thoroughly examines Java's ConcurrentHashMap, covering its evolution from JDK 1.7 segmented locks to JDK 1.8's CAS‑based design, detailing key internal fields, the thread‑safe put and remove operations, and the complex resizing and transfer mechanisms that enable high‑concurrency performance.

ConcurrentHashMapHashMapconcurrency
0 likes · 24 min read
Deep Dive into Java's ConcurrentHashMap: Implementation, Put & Remove Mechanics
Programmer DD
Programmer DD
May 15, 2020 · Backend Development

Avoid These Common Java Map Pitfalls: Nulls, Custom Keys, and Concurrency Issues

This article explains why some Map implementations reject null values, how using custom objects as keys can cause unexpected behavior, and why ConcurrentHashMap does not guarantee thread safety for compound operations, offering practical guidelines to prevent these frequent Java collection bugs.

ConcurrentHashMapHashMapMAP
0 likes · 10 min read
Avoid These Common Java Map Pitfalls: Nulls, Custom Keys, and Concurrency Issues
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Apr 26, 2020 · Fundamentals

Understanding ConcurrentHashMap: Implementation Differences between JDK 1.7 and JDK 1.8

This article explains why ConcurrentHashMap provides thread‑safe and high‑performance map operations, compares it with HashMap and Hashtable, and details the architectural changes from JDK 1.7’s segment‑lock design to JDK 1.8’s array‑list‑red‑black‑tree and CAS‑based implementation.

ConcurrentHashMapData StructuresJDK7
0 likes · 7 min read
Understanding ConcurrentHashMap: Implementation Differences between JDK 1.7 and JDK 1.8
ITFLY8 Architecture Home
ITFLY8 Architecture Home
Mar 8, 2020 · Fundamentals

Why Java’s HashMap Combines Arrays, Linked Lists, and Red‑Black Trees

This article explains the fundamentals of hash tables, compares their performance with arrays, linked lists, and binary trees, describes how Java's HashMap handles collisions using chaining and treeification, and details the evolution from JDK 7 to JDK 8, including the design of ConcurrentHashMap for thread safety.

ConcurrentHashMapData StructuresHashMap
0 likes · 23 min read
Why Java’s HashMap Combines Arrays, Linked Lists, and Red‑Black Trees
FunTester
FunTester
Feb 26, 2020 · Fundamentals

Why Thread‑Safe Collections Still Fail with Non‑Thread‑Safe Objects in Java

Through a series of Java demos, this article examines how storing non‑thread‑safe objects inside thread‑safe collections like ConcurrentHashMap or CopyOnWriteArrayList can still cause concurrency bugs, explains the underlying remove() implementation, and shows how switching to a thread‑safe Vector resolves the issue.

CollectionsConcurrentHashMapCopyOnWriteArrayList
0 likes · 8 min read
Why Thread‑Safe Collections Still Fail with Non‑Thread‑Safe Objects in Java
FunTester
FunTester
Jul 22, 2019 · Backend Development

Thread Safety Issues When Combining Thread‑Safe Methods: A ConcurrentHashMap Example

Even when using thread‑safe classes like Java's ConcurrentHashMap, combining multiple thread‑safe methods into a single operation can still cause race conditions, as demonstrated by a test where two threads concurrently execute get‑and‑put logic, leading to an unexpected map value and a failed assertion.

ConcurrentHashMapconcurrencyjava
0 likes · 3 min read
Thread Safety Issues When Combining Thread‑Safe Methods: A ConcurrentHashMap Example
Big Data Technology & Architecture
Big Data Technology & Architecture
Feb 15, 2019 · Backend Development

Deep Dive into Java 8 ConcurrentHashMap: Initialization, Treeification, Resizing, and Transfer Mechanics

This article explains the inner workings of Java 8's ConcurrentHashMap, covering how the table is initialized, how linked‑list bins are converted to red‑black trees, the resizing logic with tryPresize, and the multi‑threaded transfer process that moves entries to a larger table.

ConcurrentHashMapData Structuresconcurrency
0 likes · 17 min read
Deep Dive into Java 8 ConcurrentHashMap: Initialization, Treeification, Resizing, and Transfer Mechanics
Big Data Technology & Architecture
Big Data Technology & Architecture
Feb 15, 2019 · Fundamentals

Understanding Java 8 HashMap and ConcurrentHashMap Internals

This article provides an in‑depth tutorial on Java 8’s HashMap and ConcurrentHashMap implementations, explaining their internal structures, red‑black tree conversion, resizing mechanisms, and step‑by‑step code analysis of put, get, and initialization processes, essential for interview preparation.

ConcurrentHashMapData StructuresHashMap
0 likes · 13 min read
Understanding Java 8 HashMap and ConcurrentHashMap Internals
Big Data Technology & Architecture
Big Data Technology & Architecture
Feb 15, 2019 · Fundamentals

Deep Dive into Java HashMap and ConcurrentHashMap: Implementation, Operations, and Concurrency Mechanics

This article provides a comprehensive, step‑by‑step explanation of Java 7 HashMap and ConcurrentHashMap internals, covering their data structures, put/get algorithms, array initialization, resizing, segment locking, rehashing, and the concurrency considerations that ensure thread‑safe access.

ConcurrentHashMapData StructuresHashMap
0 likes · 22 min read
Deep Dive into Java HashMap and ConcurrentHashMap: Implementation, Operations, and Concurrency Mechanics
Java Captain
Java Captain
Feb 6, 2019 · Fundamentals

Understanding HashMap and ConcurrentHashMap in Java (JDK 1.7 and 1.8)

This article explains the internal structures and core methods of Java's HashMap and ConcurrentHashMap across JDK 1.7 and 1.8, detailing array‑linked list implementations, load factor handling, resizing, treeification, concurrency mechanisms, and performance considerations with extensive code examples.

ConcurrentHashMapHashMapjava
0 likes · 19 min read
Understanding HashMap and ConcurrentHashMap in Java (JDK 1.7 and 1.8)
Programmer DD
Programmer DD
Nov 28, 2018 · Backend Development

How Eureka Server Handles Millions of Requests with In-Memory Registry & Multi-Level Cache

This article explores Eureka Server’s core architecture, detailing its in‑memory ConcurrentHashMap registry, the 30‑second pull and heartbeat cycles, and the multi‑level caching strategy that enables a large‑scale Spring Cloud system to sustain tens of thousands of daily requests while maintaining high performance.

ConcurrentHashMapIn-Memory CacheSpring Cloud
0 likes · 9 min read
How Eureka Server Handles Millions of Requests with In-Memory Registry & Multi-Level Cache
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Nov 14, 2018 · Fundamentals

Implementation Principles of ConcurrentHashMap (CurrentHashMap) in JDK 1.7 and JDK 1.8

This article explains the underlying principles of hash tables, compares HashMap, Hashtable and ConcurrentHashMap, and details the architectural differences of ConcurrentHashMap in JDK 1.7 (segment‑based locking) versus JDK 1.8 (array‑list‑tree with CAS), including code examples and performance trade‑offs.

ConcurrentHashMapHashMapJDK1.7
0 likes · 8 min read
Implementation Principles of ConcurrentHashMap (CurrentHashMap) in JDK 1.7 and JDK 1.8
Senior Brother's Insights
Senior Brother's Insights
Jul 23, 2018 · Fundamentals

HashMap vs ConcurrentHashMap: Deep Dive into JDK 1.7 and 1.8 Implementations

This article explains the internal structures of HashMap and ConcurrentHashMap in Java, compares their JDK 1.7 and JDK 1.8 implementations, walks through the put and get algorithms with code examples, highlights performance optimizations such as treeification, and shows why ConcurrentHashMap is needed for thread‑safe access.

ConcurrentHashMapHashMapconcurrency
0 likes · 21 min read
HashMap vs ConcurrentHashMap: Deep Dive into JDK 1.7 and 1.8 Implementations
Java Captain
Java Captain
Feb 11, 2018 · Backend Development

Analyzing Java Concurrency Models: CopyOnWriteArrayList, ConcurrentHashMap, and LinkedBlockingQueue

This article examines three Java concurrency implementations—CopyOnWriteArrayList, ConcurrentHashMap, and LinkedBlockingQueue—explaining their underlying principles, code structures, and how they achieve thread‑safe read/write operations using techniques such as copy‑on‑write, CAS, and separate locks.

CASConcurrentHashMapCopyOnWriteArrayList
0 likes · 13 min read
Analyzing Java Concurrency Models: CopyOnWriteArrayList, ConcurrentHashMap, and LinkedBlockingQueue
Qunar Tech Salon
Qunar Tech Salon
Jun 3, 2015 · Fundamentals

Understanding HashMap ConcurrentModificationException and Using ConcurrentHashMap in Java

This article explains why iterating and removing entries from a HashMap throws ConcurrentModificationException, describes the internal iterator mechanism, and provides correct solutions using an Iterator or replacing HashMap with ConcurrentHashMap, including detailed explanations of ConcurrentHashMap's structure and its get, put, remove, size, and iteration implementations.

CollectionsConcurrentHashMapConcurrentModificationException
0 likes · 11 min read
Understanding HashMap ConcurrentModificationException and Using ConcurrentHashMap in Java