Tagged articles
Memory Layout
51 articles · Page 1 of 1
This article explains CPU cache hierarchy, cache line structure, mapping policies, write strategies, and MESI coherence protocol with C++ benchmarks showing 8x speedups from row-major traversal, struct alignment, and false sharing elimination using alignas(64) and hardware_destructive_interference_size.
C++CPU cacheCache-Friendly Code
0 likes · 20 min read

This article provides a comprehensive analysis of the .NET CLR runtime, covering the execution model from CIL to native code, tiered compilation, object memory layout with object headers and method tables, assembly loading via AssemblyLoadContext, Native AOT compilation benefits and limitations, exception handling mechanisms, generational garbage collection, and memory diagnostic tools.
Assembly LoadingCLRJIT Compilation
0 likes · 23 min read

This article explains how reading compiler-generated assembly helps C++ developers verify optimizations like SIMD vectorization, function inlining, and memory layout efficiency, using tools like perf and Compiler Explorer to replace guesswork with evidence-based performance tuning.
AoS vs SoAC++Godbolt
0 likes · 10 min read

This article reveals how C++ STL containers like vector, list, map, and unordered_map incur hidden performance costs through memory layout, cache locality, pointer chasing, and rehash overhead, demonstrating that theoretical time complexity often misleads because cache misses dominate real-world performance.
C++Memory LayoutSTL
0 likes · 13 min read

This article walks through the JVM's six-step process for creating a new object, explains heap allocation strategies and thread‑local buffers, details escape analysis optimizations, reveals the exact memory layout of an object including header and padding, compares handle versus direct pointer access, and describes reachability‑based garbage collection with the four Java reference types.
JVMJavaMemory Layout
0 likes · 22 min read

The article explains how an executable file is located, parsed (e.g., ELF), loaded into memory, divided into code, data, heap and stack regions, how dynamic libraries are placed, and how the OS uses the entry‑point address to start the CPU executing the program.
ELFMemory Layoutentry point
0 likes · 5 min read

This article explains the fundamental differences between C arrays and pointers by examining memory layout, mutability, sizeof behavior, function parameter handling, multidimensional arrays, and practical best‑practice guidelines, providing clear code examples that reveal why declarations like char s1[] = "liangxu" and char *s2 = "liangxu" behave differently.
Best PracticesC++Memory Layout
0 likes · 14 min read
![Why char s1[] and char *s2 Aren’t the Same: Deep Dive into C Arrays vs Pointers](https://wsrv.nl/?url=https%3A%2F%2Fmmbiz.qpic.cn%2Fmmbiz_jpg%2FIsrmVA0RIYPW1nAJrMmHpibicNeaHnBO6YBda03t5sT9RSwOToPd5nGYPDP2nEasScEMOWpUvH6aZib0ovlTXOnbw%2F0%3Fwx_fmt%3Djpeg)
This tutorial shows how C arrays are stored in the stack, global segment, and heap on a 64‑bit Linux system, using gcc compilation, gdb inspection, and concrete memory addresses to illustrate the exact layout of each region.
C++Global SegmentHeap
0 likes · 7 min read

This article explains why certain GPU performance gains require direct CUDA kernel edits and walks through fine‑grained techniques such as data‑layout restructuring, warp‑level primitives, tiled memory accesses, kernel fusion, and dynamic execution paths, backed by code examples and benchmark insights.
CUDAGPU optimizationMemory Layout
0 likes · 12 min read

This article demystifies C's memory layout by comparing it to a house, detailing each segment—from the stack and heap to global variables and the code section—while providing clear examples, common pitfalls, debugging tips, and interactive challenges to solidify understanding.
C++Memory Layoutprogramming fundamentals
0 likes · 15 min read

This article explains how C++ implements runtime polymorphism through virtual function tables, detailing their structure, memory placement, how they enable dynamic binding, and illustrating usage with single, multiple inheritance and practical code examples.
C++InheritanceMemory Layout
0 likes · 17 min read

This article traces the evolution of memory layout from early punched‑card computers through assembly‑level innovations, segment‑based designs, and virtual memory, then demonstrates a real 32‑bit Linux C++ program showing where globals, stack, heap, and mapped regions reside, and explains how this knowledge helps debug segmentation faults, stack overflows, and memory leaks.
BSSC++Memory Layout
0 likes · 13 min read


ITPUBMar 25, 2025 · Fundamentals
From double‑clicking an icon to the CPU executing the first instruction, this article walks through how an executable file is identified, loaded into memory, partitioned into code, data, heap and stack sections, and finally launched via the entry‑point address defined in the ELF format.
ELF formatMemory Layoutexecutable files
0 likes · 6 min read

This article explains Go’s empty interface, showing how it can hold values of any type, how to declare and use it in functions and data structures, and why copying between concrete slices and empty‑interface slices requires element‑wise assignment due to its two‑word memory layout.
GoMemory LayoutType System
0 likes · 5 min read

Array indexing begins at zero due to historical decisions dating back to early languages like B and C, memory layout efficiencies that avoid extra subtraction, mathematical elegance of half-open intervals, and practical advantages in loops, hashing, multidimensional arrays, and language design, making zero-based indexing the de‑facto standard.
Memory Layoutarray indexingprogramming fundamentals
0 likes · 8 min read

This article explains how C++ objects are laid out in memory, covering alignment rules, padding, the impact of member order, how to use sizeof and #pragma pack to inspect sizes, and when optimizing layout is worthwhile for performance and memory efficiency.
C++Memory Layoutperformance optimization
0 likes · 15 min read

This article dissects iOS blocks, explaining their struct‑based memory layout, the three block types, how they are transformed into C++ code with clang, and the impact of capturing variables—including value, static, global, and object references—on block behavior and lifecycle.
BlocksC++Clang
0 likes · 12 min read

This article explains the three-part structure of a Java object in the HotSpot JVM—object header, instance data, and alignment padding—detailing the Mark Word and Klass Pointer fields, their bit‑level layout, and how they affect memory size, GC age, and locking behavior.
JVMJavaMark Word
0 likes · 7 min read

This article explains the concepts of big‑endian and little‑endian byte ordering, shows memory layout examples with 0x1234, provides C code to display byte order in memory, and discusses how pointer casting behaves differently on each architecture.
Memory Layoutbig-endianendianness
0 likes · 4 min read

The article explains that an executable file contains machine instructions which the operating system parses (e.g., ELF), loads into RAM by allocating distinct memory regions for code, data, heap, stack and any dynamic libraries, then reads the entry‑point address to set the CPU’s instruction pointer and start execution.
ELFMemory Layoutexecutable file
0 likes · 5 min read

This article explains how an executable file is identified, loaded into memory, and organized into code, data, heap, and stack segments, describing the OS’s role, ELF format details, dynamic library placement, and how the CPU finds the program’s entry point to start execution.
ELFMemory Layoutexecutable
0 likes · 6 min read

An overview of the BSS, data, and text segments in program memory—explaining their roles for uninitialized, initialized global variables and executable code, plus heap and stack basics, illustrated with C examples that show how segment placement affects binary size.
Data SegmentHeapMemory Layout
0 likes · 7 min read

This article explains how programs are laid out in memory, walks through the compilation and linking stages, compares static and dynamic linking, and shows why dynamic libraries reduce disk and memory usage while making bug fixes easier.
Memory Layoutcompilationdynamic linking
0 likes · 8 min read

This article explains the memory layout of a program, the compilation and linking processes, and compares static and dynamic libraries, highlighting how static linking duplicates code while dynamic linking shares libraries to reduce disk and memory usage.
Dynamic LibraryMemory LayoutShared Library
0 likes · 7 min read

This article explains how NumPy stride differences caused a 100× slowdown when resizing images from a pygame Surface, demonstrates how to reinterpret the underlying memory layout using ctypes to achieve a 100× speedup with OpenCV, and discusses the safety implications of such low‑level Python tricks.
Memory LayoutNumPyOpenCV
0 likes · 19 min read

This article explains how programs are laid out in memory, the roles of code, data, heap, and stack sections, and compares static linking, which bundles all code into the executable, with dynamic linking, which loads shared libraries at runtime to save disk and memory space.
LibrariesMemory Layoutcompilation
0 likes · 9 min read

This article explains C language memory partitioning—including stack, heap, global/static, constant, and code sections—illustrates their characteristics and growth directions, then applies the concepts to STM32F103 by showing memory map details and providing a complete Keil‑based C program that prints the addresses of variables in each region.
C++Data SegmentEmbedded
0 likes · 10 min read

This article explains the C language memory segmentation—including stack, heap, global/static, constant, and code areas—illustrates their behavior on STM32F103 with Keil V5, and provides detailed example code that prints the addresses of variables in each region to demonstrate allocation and lifetime.
C++EmbeddedHeap
0 likes · 9 min read

This article explains the JVM's object creation process—including stack allocation, TLAB checks, Eden and Survivor spaces, and GC handling—and details the memory layout of Java objects, covering object headers, class pointers, array lengths, padding, and the effect of compressed oops on 32‑bit versus 64‑bit systems.
JVMJavaMemory Layout
0 likes · 9 min read

This article provides a comprehensive guide to C structures, covering declaration, variable definition, typedef aliases, initialization methods, pointer usage, member access, memory layout, nested structs, and bit fields, complete with code examples and visual illustrations to help readers understand and apply these concepts effectively.
C++Memory LayoutStruct
0 likes · 12 min read

This article explains how C++ implements runtime polymorphism through virtual function tables, analyzes the memory layout of single‑ and multiple‑inheritance classes using gcc and gdb, and clarifies the role of thunks and offset adjustments for correct virtual calls.
C++Memory LayoutMultiple Inheritance
0 likes · 20 min read

This article explains the purpose and proper use of C++'s virtual keyword, illustrating how virtual functions enable polymorphism, detailing class memory layout with vtables and vptrs, comparing performance impacts, and outlining when virtual functions and destructors are truly necessary.
C++Memory LayoutPolymorphism
0 likes · 15 min read

The article demonstrates how to examine a running Go program’s memory layout by defining example structs, using unsafe.Sizeof/Alignof, dumping writable regions via a Bash script and GDB, and locating fields and string constants in the resulting memory dumps to verify object representation.
GoHeap InspectionLinux
0 likes · 27 min read

This article examines how PHP stores variables internally by analyzing the zval structure defined in the C source code, detailing its fields, type flags, memory layout, and associated macros, and explains why each variable occupies 16 bytes at runtime.
BackendC++Memory Layout
0 likes · 8 min read

This article explains how Java objects are laid out in the JVM heap, why fields are reordered and padded for alignment, how false sharing degrades performance, and how the @Contended annotation and compressed oops help mitigate these issues, all backed by detailed diagrams and code examples.
JVMJavaMemory Layout
0 likes · 56 min read

This article explains Java object memory layout, the role of the mark word in locking, the evolution of synchronized locks from biased to lightweight and heavyweight, and demonstrates these concepts with JOL visualizations, code examples, and lock‑upgrade diagrams.
JVMJavaLock
0 likes · 16 min read

This article explores how Go implements the empty interface (interface{}) at the binary level, detailing stack frame allocation, compiler‑generated helper functions, pointer structures, and runtime optimizations that together reveal why an empty interface is essentially two consecutive pointers in memory.
GoMemory LayoutRuntime
0 likes · 11 min read

This article explains how Java objects are stored in memory, analyzes the heap layout, object header, instance data, and padding, demonstrates the byte size of a new Object() with and without compressed OOPs, and discusses object access methods and garbage‑collection regions.
Memory LayoutObject Sizecompressed-oops
0 likes · 12 min read

The article explains how Position Independent Code (PIC) enables code to run at any address using GOT and PLT tricks, how Position Independent Executables (PIE) extend this to whole binaries, and how Linux’s Address Space Layout Randomization (ASLR) leverages PIE to fully randomize process memory, making exploitation significantly harder.
ASLRLinuxMemory Layout
0 likes · 13 min read

This article delves into the inner workings of Swift enums—covering their compilation to SIL, memory representation, use of MemoryLayout for size and alignment, techniques for retrieving variable addresses, the role of raw values and associated values, and how default protocols like Equatable and Hashable are automatically provided.
Associated ValueEnumMemory Layout
0 likes · 19 min read

This article explains the JVM's process for creating Java objects, covering class loading checks, memory allocation strategies such as bump‑the‑pointer and free‑list, object header composition, instance data layout, alignment padding, and the ways references locate objects via handles or direct pointers.
JVMMemory LayoutObject Creation
0 likes · 7 min read

This article explains how C++ compilers implement virtual functions using a hidden vptr and virtual table, showing how class size grows from 1 to 8 bytes, detailing memory layouts for single, multiple, and diamond inheritance, and providing commands to dump vtable and layout information.
C++InheritanceMemory Layout
0 likes · 14 min read

This article explores how Objective‑C objects are converted to low‑level C/C++ structures, compares the results of class_getInstanceSize, malloc_size and sizeof, and explains memory‑alignment rules, member ordering, padding, and inheritance effects on the actual memory footprint of iOS objects.
Memory LayoutObjective-C++Runtime
0 likes · 22 min read

This article explains how Swift objects are created and destroyed, how method calls are implemented compared with Objective‑C, the memory layout of Swift classes, the role of virtual tables, the impact of compiler optimizations, and the feasibility of runtime method replacement, illustrated with extensive C‑style pseudocode examples.
Memory LayoutRuntimeSWIFT
0 likes · 34 min read

This article explains the JVM Oop‑Klass model, details how Java objects are represented in heap memory, shows how to calculate their size using source code analysis, HSDB, Instrumentation, Unsafe, and third‑party tools, and provides practical examples and code snippets.
HSDBJVMJava
0 likes · 15 min read

This article explains Linux process management fundamentals, covering process concepts, lifecycle, threads, priorities, context switches, interrupt handling, process states, memory layout, and the O(1) CPU scheduler, providing clear diagrams and practical insights for developers and system engineers.
LinuxMemory LayoutProcess Management
0 likes · 14 min read

This article explains the fundamental differences between Go arrays and slices, describes their memory layout and value semantics, illustrates various slice declaration forms, and details the rules governing slice capacity growth with example code and visual diagrams.
GoMemory Layoutarray
0 likes · 6 min read


JD TechAug 16, 2018 · Mobile Development
This article explores the low‑level implementation of Objective‑C objects by examining instance memory allocation, the differences between class_getInstanceSize and malloc_size, the internal structures of instance, class, and meta‑class objects, and how isa and superclass pointers link them together.
Memory LayoutObjective-C++Runtime
0 likes · 16 min read

This article explores Swift's memory model and pointer mechanics, explains how HandyJSON converts JSON to class instances without runtime support, demonstrates MemoryLayout utilities, and shows practical techniques for modifying struct and class properties directly in memory.
JSON parsingMemory LayoutSWIFT
0 likes · 17 min read

This article explains how a running program's code and variables are organized in Linux memory, covering virtual address mapping, the purpose of each segment (text, rodata, data, bss, stack, heap), and demonstrates the concepts with concrete C examples and memory‑map screenshots.
BSSHeapLinux
0 likes · 11 min read


ITPUBAug 3, 2016 · Fundamentals
This article explains how Linux programs are loaded, the distinction between ELF sections and segments, virtual‑to‑physical address translation, the role of the MMU, brk/sbrk usage, address‑space layout, and practical steps to reproduce and avoid segmentation faults.
ELFLinuxMemory Layout
0 likes · 15 min read
