Tag

ConcurrentHashMap

0 views collected around this technical thread.

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.

CASConcurrentHashMapJava
0 likes · 36 min read
Detailed Explanation of Java ConcurrentHashMap Source Code: Constructors, put, get, resize, and Concurrency Mechanisms
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.

ConcurrentHashMapDataStructureJava
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.

ConcurrentHashMapJavaMemory Model
0 likes · 15 min read
Is Java's ConcurrentHashMap Strongly Consistent? Unveiling the Truth
Cognitive Technology Team
Cognitive Technology Team
Mar 11, 2025 · Backend Development

Design Principles and Limitations of Java's Striped64 and ConcurrentHashMap

The article examines the architectural concepts behind Java's Striped64 and ConcurrentHashMap, explains how they achieve high‑performance concurrency, and discusses the memory, complexity, and scalability drawbacks that developers should consider when choosing these data structures for backend systems.

BackendConcurrentHashMapJava
0 likes · 6 min read
Design Principles and Limitations of Java's Striped64 and ConcurrentHashMap
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.

Backend DevelopmentConcurrentHashMapJava
0 likes · 11 min read
Mastering ConcurrentHashMap: Build High‑Performance Caches in Spring Boot 3
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
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.

Backend DevelopmentConcurrentHashMapData Structures
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.

BackendConcurrentHashMapJava
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.

ConcurrentHashMapJavaNULL
0 likes · 4 min read
Why ConcurrentHashMap Disallows Null Keys and Values in Java
Selected Java Interview Questions
Selected Java Interview Questions
Jan 23, 2024 · Backend Development

Design and Implementation of a Local Cache Component in Spring Boot

This article explains how to build a robust, thread‑safe local cache for Spring Boot applications by defining cache domain models, abstract managers, a centralized registry, and scheduled refresh tasks, while providing complete Java code examples and best‑practice recommendations.

CacheConcurrentHashMapDesignPattern
0 likes · 23 min read
Design and Implementation of a Local Cache Component in Spring Boot
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
Architect's Guide
Architect's Guide
Jan 13, 2023 · Backend Development

Understanding ConcurrentHashMap Constructors, Insertion, Treeification, and Resizing in Java

This article explains the internal mechanisms of Java's ConcurrentHashMap, covering its constructors, element insertion via put and putVal, the sizeCtl variable, treeification of bins, counting operations, and the complex multi‑threaded resizing process, with detailed code examples.

ConcurrentHashMapData StructuresJava
0 likes · 21 min read
Understanding ConcurrentHashMap Constructors, Insertion, Treeification, and Resizing in Java
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)
Selected Java Interview Questions
Selected Java Interview Questions
May 30, 2022 · Backend Development

Understanding Java ConcurrentHashMap: Implementation, Locking, and Performance

This article explains the shortcomings of HashMap, compares Hashtable, synchronizedMap, and ConcurrentHashMap implementations in JDK 7 and JDK 8, discusses lock states, fail‑fast vs fail‑safe behavior, and provides code examples and optimization tips for thread‑safe map operations.

ConcurrentHashMapJDK7JDK8
0 likes · 12 min read
Understanding Java ConcurrentHashMap: Implementation, Locking, and Performance
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().

ConcurrentHashMapJavaMemory Model
0 likes · 14 min read
Understanding Strong vs. Weak Consistency in Java's ConcurrentHashMap
Selected Java Interview Questions
Selected Java Interview Questions
Feb 22, 2022 · Fundamentals

Understanding the Design and Thread‑Safety Mechanisms of Java ConcurrentHashMap

This article explains the design principles, lock mechanisms, CAS operations, and resizing strategies of Java's ConcurrentHashMap, illustrating how it achieves thread safety and high concurrency compared to HashMap and Hashtable in modern Java applications.

CASConcurrentHashMapData Structure
0 likes · 19 min read
Understanding the Design and Thread‑Safety Mechanisms of Java ConcurrentHashMap
Wukong Talks Architecture
Wukong Talks Architecture
Oct 19, 2021 · Backend Development

Understanding Eureka Server Registration Process: A Source Code Walkthrough

This article explains how Eureka Server receives and stores service registration requests by examining the relevant source code, highlighting the use of Jersey for HTTP handling, ConcurrentHashMap for registration storage, and ReentrantReadWriteLock for fine‑grained concurrency control.

Backend DevelopmentConcurrentHashMapEureka
0 likes · 8 min read
Understanding Eureka Server Registration Process: A Source Code Walkthrough