Tagged articles
6 articles
Page 1 of 1
Deepin Linux
Deepin Linux
Sep 23, 2025 · Fundamentals

Mastering Linux Memory Allocation: When to Use brk vs mmap

This article explains the low‑level mechanisms of brk and mmap in Linux, compares their characteristics, shows why malloc selects one over the other based on allocation size, and provides practical code examples, performance tips, and common pitfalls for developers.

LinuxMemory ManagementPerformance Optimization
0 likes · 29 min read
Mastering Linux Memory Allocation: When to Use brk vs mmap
Deepin Linux
Deepin Linux
Feb 27, 2025 · Fundamentals

Understanding malloc and free: Memory Allocation Mechanisms in C

This article explains how the C functions malloc and free allocate and release memory, covering stack vs heap, the brk and mmap system calls, fragmentation, header metadata, and why both allocation strategies are needed for efficient memory management.

C programmingFreeHeap
0 likes · 17 min read
Understanding malloc and free: Memory Allocation Mechanisms in C
Linux Kernel Journey
Linux Kernel Journey
Dec 8, 2024 · Fundamentals

Linux Kernel Source Analysis: Understanding Heap Memory Management

This article explains how the Linux kernel implements heap memory management, covering the heap data structure, the mm_struct fields start_brk and brk, the brk/sbrk and malloc/free allocation methods, the brk and mmap system calls, and the internal glibc structures heap_info and malloc_state that track heap state.

Heap MemoryKernelLinux
0 likes · 17 min read
Linux Kernel Source Analysis: Understanding Heap Memory Management
Liangxu Linux
Liangxu Linux
Jul 27, 2024 · Fundamentals

Does malloc Allocate Memory? Exploring Virtual Memory, brk, and Page Faults

This article explains why calling malloc in C only reserves virtual address space, how the kernel maps it to physical memory on demand, and the roles of the brk pointer, memory layout, and page‑fault handling, illustrated with a 1 GB allocation example and detailed diagrams.

C programmingMemory ManagementPage Fault
0 likes · 7 min read
Does malloc Allocate Memory? Exploring Virtual Memory, brk, and Page Faults
OPPO Kernel Craftsman
OPPO Kernel Craftsman
Jun 12, 2020 · Fundamentals

Linux Kernel Virtual Memory Management: Process Virtual Address Space and Allocation

The article explains Linux kernel virtual memory management on 64‑bit ARM64 Android systems, detailing user‑ and kernel‑space address layout, physical vs. linear addresses, allocation mechanisms such as brk and mmap, common allocators, key structures like mm_struct and vm_area_struct, and the functions that control mmap layout and unmapped‑area selection.

ARM64ASLRKernel Internals
0 likes · 20 min read
Linux Kernel Virtual Memory Management: Process Virtual Address Space and Allocation