Tagged articles
ConcurrentHashMap
91 articles · Page 1 of 1
A developer shares their successful China Merchants Bank Java backend interview experience, detailing 20 technical questions covering HashMap, ConcurrentHashMap, synchronization, thread pools, Redis cache penetration, MySQL indexing, Spring Boot auto-configuration, Agent memory, RAG, multi-agent orchestration, and more, with answers and preparation tips.
AgentAuto-configurationBackend
0 likes · 35 min read

At 200k QPS, async-profiler flame graphs revealed that synchronous stack-trace capture on every log line and full-table scans of a fee-item cache consumed 25% of CPU; removing the stack trace and indexing the cache by code dropped single-node CPU from 65% to 48% with no RT regression, validated by controlled ablation experiments and production rollout.
CPU optimizationConcurrentHashMapFlame Graph
0 likes · 13 min read


DabaoshiAug 18, 2026 · Backend Development
This article explains why HashMap isn’t thread‑safe, how Hashtable’s single lock hurts performance, and walks through the evolution from JDK 1.7 segment locks to JDK 1.8’s CAS‑plus‑synchronized bucket locking, including lock‑free size counting and a comparison with CopyOnWriteArrayList for read‑heavy scenarios.
ConcurrencyConcurrentHashMapCopyOnWriteArrayList
0 likes · 17 min read

This article walks through ten core Java collection topics—including ArrayList vs LinkedList, HashMap internals across JDK 7 and 8, the put and resize processes, ConcurrentHashMap design, HashSet implementation, fail‑fast vs fail‑safe iterators, and the difference between Collection and Collections—providing the detailed analysis and code examples interviewers expect.
ConcurrentHashMapHashMapInterview
0 likes · 10 min read

This article reviews common Java concurrency pitfalls—including deadlocks, ThreadLocal memory leaks, Integer‑cache loops, unbounded thread‑pool queues, and swallowed exceptions—illustrates each with code samples, analyzes real production incidents, and provides a concise checklist and tool‑selection guide for safe concurrent programming.
Best PracticesConcurrencyConcurrentHashMap
0 likes · 9 min read

This article thoroughly examines Java's ConcurrentHashMap by tracing its evolution from JDK 1.5's segment‑lock design to JDK 8's CAS‑plus‑synchronized implementation, detailing internal structures, put/get algorithms, resizing mechanics, performance trade‑offs, and common interview questions.
ConcurrencyConcurrentHashMapJDK7
0 likes · 12 min read

The article explains how HashMap can enter an infinite loop, lose data, or corrupt entries when accessed concurrently, illustrates the root causes with JDK 1.7 and 1.8 source code, compares alternative thread‑safe maps, and shows how to answer this classic interview question.
ConcurrentHashMapData RaceHashMap
0 likes · 7 min read

This article walks through five proven Java 21 concurrency tuning techniques—including non‑blocking CompletableFuture pipelines, StampedLock for read‑heavy workloads, bounded queues with CallerRunsPolicy, atomic computeIfAbsent usage in ConcurrentHashMap, and correct virtual‑thread patterns—showing how each can dramatically improve throughput and stability in high‑load systems.
CompletableFutureConcurrencyConcurrentHashMap
0 likes · 9 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 9 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 7 min read

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.
ConcurrentHashMapInterviewJava
0 likes · 27 min read

The article explains how Java records, with their built‑in immutability and auto‑generated methods, eliminate mutable state, reduce lock contention, and improve throughput in high‑concurrency architectures, providing concrete code examples and comparisons with traditional mutable beans.
ConcurrencyConcurrentHashMapJava
0 likes · 9 min read

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.
ConcurrentHashMapConcurrentModificationExceptionCopyOnWriteArrayList
0 likes · 7 min read

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 16 min read

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

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

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.
ConcurrencyConcurrentHashMapJava
0 likes · 42 min read

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.
ConcurrencyConcurrentHashMapDataStructure
0 likes · 11 min read

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

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.
ConcurrentHashMapConsistencyJava
0 likes · 15 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 6 min read

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

Even when you replace HashMap with ConcurrentHashMap and use ThreadLocal for per‑thread data, hidden pitfalls in thread‑pooled environments can cause data leakage and race conditions, but proper cleanup and atomic operations can restore safety, as demonstrated with concrete Java examples.
ConcurrentHashMapJavaThreadLocal
0 likes · 10 min read

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.
CachingConcurrentHashMapbackend development
0 likes · 11 min read

This guide explains why standard Java collections are not thread‑safe, introduces their concurrent counterparts such as Vector, ConcurrentHashMap, and various BlockingQueue implementations, and provides concrete code examples and usage patterns for safe multi‑threaded programming.
BlockingQueueConcurrencyConcurrentHashMap
0 likes · 12 min read

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

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.
ConcurrentHashMapJavaMemoryLeak
0 likes · 8 min read

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

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 17 min read

This article explains how Java's ConcurrentHashMap provides thread‑safe, high‑performance map operations by comparing the segmented‑lock design of JDK 7 with the fine‑grained locking and CAS approach of JDK 8, and includes a practical multithreaded code example.
ConcurrencyConcurrentHashMapJava
0 likes · 5 min read

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.
ConcurrentHashMapJavaMultithreading
0 likes · 6 min read

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

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

This article explores why using an Integer as a lock can cause synchronized to malfunction, demonstrates the issue with a ticket‑selling example, analyzes thread dumps and JVM bytecode, and presents reliable alternatives such as class‑level locks or map‑based lock objects.
ConcurrentHashMapJavaSynchronized
0 likes · 15 min read

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

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

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.
AQSBlockingQueueConcurrency
0 likes · 21 min read

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.
ConcurrentHashMapJavadata structures
0 likes · 4 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 21 min read

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.
ConcurrentHashMapJDK1.7JDK1.8
0 likes · 10 min read

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.
ConcurrentHashMapJavaMultithreading
0 likes · 7 min read

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

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().
ConcurrencyConcurrentHashMapConsistency
0 likes · 14 min read

This article explains the internal structure of Java's HashMap and ConcurrentHashMap, covering hash calculation, bucket handling, load factor, resizing, collision resolution with linked lists and red‑black trees, and the differences in thread‑safety and performance between these map implementations.
ConcurrencyConcurrentHashMapHashMap
0 likes · 12 min read

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

This article dives deep into Java's ConcurrentHashMap, explaining how it uses CAS, volatile fields, lock‑striping and cooperative resizing to provide thread‑safe get, put and size operations while maximizing concurrency and performance.
CASConcurrentHashMapJava
0 likes · 33 min read

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.
ConcurrentHashMapEurekaJava
0 likes · 8 min read

This article explains the internal data structures, hashing mechanisms, resizing behavior, and concurrency strategies of Java's HashMap and ConcurrentHashMap, covering their evolution from JDK 1.7 to 1.8, the use of linked lists, red‑black trees, and lock implementations.
ConcurrencyConcurrentHashMapHashMap
0 likes · 14 min read

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.
ConcurrentHashMapJavaJava 8
0 likes · 9 min read

This article explains the structural changes of ConcurrentHashMap in JDK 8, covering the new table layout, node types, hash spreading, initialization, resizing mechanics, treeification, and the lock‑free algorithms that enable concurrent expansion and high‑performance operations.
ConcurrencyConcurrentHashMapJDK8
0 likes · 31 min read

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.
ConcurrentHashMapCopyOnWriteArrayListJava
0 likes · 12 min read

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

After observing TiDB taking 35 minutes versus Oracle’s 15 minutes for a massive batch job, we traced the slowdown to MyBatis’s use of ConcurrentHashMap.computeIfAbsent in JDK 8, which caused thread blocking, and resolved it by upgrading to JDK 9 and applying MyBatis patches.
BatchProcessingConcurrentHashMapJDK8
0 likes · 11 min read

This article dissects Java 7 and Java 8 ConcurrentHashMap internals, explaining how segments, volatile fields, CAS, lock‑free reads, the put method, resizing, and size calculation work together to provide thread‑safe high‑throughput map operations.
ConcurrencyConcurrentHashMapJava
0 likes · 24 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 10 min read

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.
ConcurrentHashMapHashMapJava
0 likes · 48 min read

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.
ConcurrencyConcurrentHashMapJDK8
0 likes · 9 min read

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

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

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.
ChatroomConcurrentHashMapJava
0 likes · 14 min read

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

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.
ConcurrencyConcurrentHashMapJDK
0 likes · 24 min read

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.
BackendConcurrencyConcurrentHashMap
0 likes · 15 min read

This article explains how using a non‑thread‑safe HashMap in a multithreaded Java program can cause deadlocks, CPU spikes, and memory leaks, analyzes the underlying cause in the put method, and presents safer alternatives such as Collections.synchronizedMap and ConcurrentHashMap.
Collections.synchronizedMapConcurrentHashMapHashMap
0 likes · 9 min read

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 49 min read

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

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.
ConcurrentHashMapHashMapdata structures
0 likes · 13 min read

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.
ConcurrentHashMapJavaMemory Leak
0 likes · 8 min read

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.
ConcurrentHashMapJavaMemory Leak
0 likes · 8 min read

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.
ConcurrentHashMapHashMapJDK
0 likes · 14 min read

The article explains how read‑modify‑write race conditions can occur when updating a ConcurrentHashMap from multiple threads, demonstrates a failing JUnit example, and shows how using the atomic compute method with a lambda expression eliminates the race and ensures thread‑safe updates.
ComputeConcurrencyConcurrentHashMap
0 likes · 7 min read

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 24 min read

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.
ConcurrentHashMapHashMapJava
0 likes · 10 min read

This article explains how ConcurrentHashMap ensures thread safety in Java, comparing the lock‑segmentation design of JDK 7 with the CAS‑based, bucket‑level synchronization of JDK 8, and includes key source code excerpts illustrating the insertion process.
CASConcurrencyConcurrentHashMap
0 likes · 11 min read

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.
ConcurrentHashMapJDK7JDK8
0 likes · 7 min read

This article explains why Java 8's ConcurrentHashMap.get() operation is lock‑free, describing the underlying data‑structure changes from JDK 1.7 to 1.8, the role of volatile‑marked Node fields and array, and how visibility and cache‑coherence guarantee thread‑safe reads.
ConcurrentHashMapJDK8Java
0 likes · 10 min read

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.
ConcurrentHashMapHashMapdata structures
0 likes · 23 min read

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.
ConcurrencyConcurrentHashMapCopyOnWriteArrayList
0 likes · 8 min read

This article explains why HashMap is unsafe in multithreaded environments, how ConcurrentHashMap uses segmented locks and immutable entries to achieve high concurrency, and details its internal data structures, core operations, and performance considerations with illustrative Java code examples.
ConcurrencyConcurrentHashMapHashMap
0 likes · 21 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 3 min read

This article explains the hidden multithreading bugs in JDK 7 HashMap and JDK 8 ConcurrentHashMap that can cause 100% CPU usage, demonstrates how to reproduce them, and offers practical ways to avoid or resolve the issue.
CPUConcurrentHashMapJDK8
0 likes · 4 min read

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.
ConcurrencyConcurrentHashMapJava
0 likes · 17 min read

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.
ConcurrentHashMapHashMapJava
0 likes · 13 min read

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 22 min read

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

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.
ConcurrentHashMapEurekaIn-Memory Cache
0 likes · 9 min read

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 8 min read

Explore the inner workings of Java’s HashMap and ConcurrentHashMap across JDK 1.7 and 1.8, examining their data structures, key methods like put and get, performance optimizations such as treeification, concurrency mechanisms, and practical insights for developers aiming to master these core collections.
ConcurrencyConcurrentHashMapHashMap
0 likes · 19 min read

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.
ConcurrencyConcurrentHashMapHashMap
0 likes · 21 min read

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

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.
ConcurrentHashMapConcurrentModificationExceptionHashMap
0 likes · 11 min read
