Tag

Memory Model

0 views collected around this technical thread.

Cognitive Technology Team
Cognitive Technology Team
May 17, 2025 · Fundamentals

Understanding Memory Consistency Models: From Sequential Consistency to x86‑TSO and Weak Memory Models

This article explains how modern multiprocessor hardware and compiler optimizations affect program behavior, introduces memory consistency models such as sequential consistency, x86‑TSO, and ARM/POWER weak models, demonstrates their differences with litmus tests, and discusses the DRF‑SC guarantee for data‑race‑free programs.

ARMDRF-SCMemory Model
0 likes · 27 min read
Understanding Memory Consistency Models: From Sequential Consistency to x86‑TSO and Weak Memory Models
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 25, 2025 · Fundamentals

Understanding the Java Memory Model and Its Interaction with Hardware Memory Architecture

This article explains how the Java Memory Model defines the interaction between threads, thread stacks, and the heap, illustrates these concepts with diagrams and example code, and discusses how modern hardware memory architecture, caches, and CPU registers affect visibility and race conditions in concurrent Java programs.

Hardware ArchitectureJavaMemory Model
0 likes · 11 min read
Understanding the Java Memory Model and Its Interaction with Hardware Memory Architecture
Java Tech Enthusiast
Java Tech Enthusiast
Feb 17, 2025 · Fundamentals

Why a Java Volatile Example May Terminate Without Volatile

The program that loops on a non‑volatile boolean flag sometimes terminates because changing the counter to a volatile int or to an Integer causes the JVM to emit hidden memory barriers on reference writes, making the flag visible, but this behavior is JVM‑specific and not a reliable substitute for declaring the flag volatile.

HotSpotJVMJava
0 likes · 11 min read
Why a Java Volatile Example May Terminate Without Volatile
Sanyou's Java Diary
Sanyou's Java Diary
Sep 26, 2024 · Fundamentals

Mastering Java volatile: Visibility, Atomicity, and Memory Model Explained

This article provides a comprehensive guide to Java's volatile keyword, covering its pronunciation, core features such as visibility, lack of atomicity, and instruction reordering prevention, the Java Memory Model, cache‑coherence mechanisms, practical code examples, and best‑practice scenarios like double‑checked locking and when to prefer volatile over heavier synchronization constructs.

JMMJavaMemory Model
0 likes · 21 min read
Mastering Java volatile: Visibility, Atomicity, and Memory Model Explained
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Feb 21, 2024 · Fundamentals

Understanding the JVM Memory Model and Its Runtime Data Areas

This article explains the JVM memory model, detailing the five runtime data areas—heap, method area, JVM stack, native method stack, and program counter—along with their structures, configuration parameters, and roles in Java execution and performance tuning.

Garbage CollectionJVMJava
0 likes · 9 min read
Understanding the JVM Memory Model and Its Runtime Data Areas
Cognitive Technology Team
Cognitive Technology Team
Oct 13, 2023 · Fundamentals

Understanding Java Volatile Happens‑Before Rules for Write and Read Operations

This article explains why a write to a volatile variable in Java establishes a happens‑before relationship with a subsequent read in another thread, detailing the visibility rules, ordering constraints with ordinary variables, and the transitive nature of these guarantees.

Happens-BeforeJavaMemory Model
0 likes · 3 min read
Understanding Java Volatile Happens‑Before Rules for Write and Read Operations
New Oriental Technology
New Oriental Technology
May 25, 2023 · Fundamentals

Deep Dive into Java volatile: CPU Cache Architecture, MESI Protocol, JMM and Happens‑Before

This article thoroughly explains the low‑level implementation of Java's volatile keyword by analysing CPU multi‑level cache design, the MESI cache‑coherency protocol, the Java Memory Model, memory barriers, the happens‑before principle, and the impact on singleton patterns and synchronized blocks.

CPU cacheHappens-BeforeJMM
0 likes · 36 min read
Deep Dive into Java volatile: CPU Cache Architecture, MESI Protocol, JMM and Happens‑Before
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
May 4, 2023 · Fundamentals

Comprehensive Guide to JVM Memory Model, Garbage Collection Algorithms, Collectors, Performance Tuning, and Tools

This article provides a comprehensive overview of the JVM, covering its memory model, heap and stack structures, four garbage‑collection algorithms, seven collectors including G1 and ZGC, performance‑tuning steps, analysis tools, and guidance on obtaining the full series of resources.

Garbage CollectionJVMJava
0 likes · 5 min read
Comprehensive Guide to JVM Memory Model, Garbage Collection Algorithms, Collectors, Performance Tuning, and Tools
Mike Chen's Internet Architecture
Mike Chen's Internet Architecture
Apr 16, 2023 · Fundamentals

Understanding Java's Volatile Keyword: Memory Model, Visibility, and Implementation Details

This article explains the Java volatile keyword, covering its role in guaranteeing visibility and ordering in multithreaded environments, the underlying Java Memory Model concepts of main and working memory, the eight JMM actions, and practical implementation details with illustrative examples.

JMMJavaMemory Model
0 likes · 7 min read
Understanding Java's Volatile Keyword: Memory Model, Visibility, and Implementation Details
Sanyou's Java Diary
Sanyou's Java Diary
Mar 16, 2023 · Fundamentals

Mastering Java’s volatile: Visibility, Atomicity, and Memory Barriers Explained

This article provides a comprehensive guide to Java's volatile keyword, covering its pronunciation, role in the Java Memory Model, visibility guarantees, lack of atomicity, instruction reordering prevention, memory barriers, and practical usage patterns such as double‑checked locking and atomic classes.

AtomicityJMMJava
0 likes · 20 min read
Mastering Java’s volatile: Visibility, Atomicity, and Memory Barriers Explained
政采云技术
政采云技术
Dec 13, 2022 · Frontend Development

Understanding the Shape of JavaScript Code in V8 Memory: Stack, Heap, and Constant Pool

This article explains how JavaScript code is represented in V8's memory, covering primitive types, the roles of the stack, heap, and constant pool, as well as function prototypes, variable hoisting, and garbage collection, with clear examples and diagrams.

Constant PoolFunctionsJavaScript
0 likes · 12 min read
Understanding the Shape of JavaScript Code in V8 Memory: Stack, Heap, and Constant Pool
Laravel Tech Community
Laravel Tech Community
Aug 3, 2022 · Fundamentals

Go 1.19 Release: New Features, Improvements, and Compatibility

Go 1.19 has been released, bringing toolchain, runtime, and library enhancements such as refined generics, improved documentation comments, a formally aligned memory model with new atomic types, security changes to os/exec, soft memory‑limit garbage collection, a new unix build constraint, and numerous performance optimizations, all while preserving full Go 1 compatibility.

GoMemory Modelgenerics
0 likes · 4 min read
Go 1.19 Release: New Features, Improvements, and Compatibility
Laravel Tech Community
Laravel Tech Community
Jun 13, 2022 · Backend Development

Key Changes in Go 1.19 Release

Go 1.19, slated for an August 2022 release, brings minor language tweaks, a revised memory model aligned with major languages, new LoongArch support, Unix build constraints, runtime soft memory limits, compiler and assembler enhancements, and an updated ELF linker format.

GoMemory ModelRelease Notes
0 likes · 3 min read
Key Changes in Go 1.19 Release
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
High Availability Architecture
High Availability Architecture
Mar 16, 2022 · Fundamentals

Understanding Ordering Issues and Volatile in Java Concurrency

This article explains why intuition fails in multithreaded Java programs, demonstrates ordering problems with simple thread examples, shows how instruction reordering and JIT optimizations can produce unexpected results, and presents the volatile keyword and jcstress testing as reliable solutions to ensure correct visibility and ordering.

JavaMemory Modelconcurrency
0 likes · 9 min read
Understanding Ordering Issues and Volatile in Java Concurrency
政采云技术
政采云技术
Mar 15, 2022 · Fundamentals

Understanding Java Class Loading Mechanism and Runtime Data Areas

This article explains how the JVM loads and links class files, describes the five runtime data areas—including the Method Area, Heap, JVM Stacks, Program Counter, and Native Method Stack—and details the class‑loader hierarchy and the parent‑delegation model used during class loading.

BytecodeClass LoadingClassLoader
0 likes · 17 min read
Understanding Java Class Loading Mechanism and Runtime Data Areas
Spring Full-Stack Practical Cases
Spring Full-Stack Practical Cases
Mar 1, 2022 · Fundamentals

Why Volatile Isn’t Enough: Mastering Atomicity and the Java Memory Model

This article explains the concept of atomicity, demonstrates atomic and non‑atomic Java code using volatile and AtomicInteger, discusses visibility, instruction reordering, the happens‑before principle, and how the JVM implements its memory model with heap and stack structures.

AtomicityJavaMemory Model
0 likes · 10 min read
Why Volatile Isn’t Enough: Mastering Atomicity and the Java Memory Model
Zhuanzhuan Tech
Zhuanzhuan Tech
Jan 26, 2022 · Fundamentals

Understanding the Happens‑Before Principle in Java Concurrency

This article explains the Java Happens‑Before principle, detailing its rules such as program order, monitor lock, volatile variable, thread start, termination, interruption, and finalizer, and demonstrates each rule with clear code examples to illustrate visibility guarantees in concurrent programming.

Happens-BeforeJavaMemory Model
0 likes · 28 min read
Understanding the Happens‑Before Principle in Java Concurrency