Tagged articles
memory fragmentation
20 articles · Page 1 of 1
This article comprehensively covers Linux memory organization, virtual address spaces, buddy and slab allocation algorithms, memory usage scenarios, common C/C++ memory pitfalls, and practical monitoring commands.
C++ smart pointersDMALinux memory management
0 likes · 23 min read


liandkSep 18, 2026 · Backend Development
This article reveals how long GC stop-the-world pauses cause random API timeouts without errors, detailing two fault scenarios, a four-step GC log analysis SOP with specific JVM flags, four root causes including young generation sizing and memory fragmentation, and optimization strategies from emergency restarts to G1/ZGC upgrades with monitoring alerts.
Full GCG1GC
0 likes · 15 min read

This article explains Linux process virtual address spaces, details the multi‑step internals of the C++ new operator, and analyzes its memory‑fragmentation, time, and space overheads through code examples and benchmarks, then offers practical mitigation techniques such as memory pools and smart pointers.
C++LinuxPerformance Analysis
0 likes · 26 min read

This article explains Linux memory compaction—from its core principles and page‑migration mechanics to the different compaction strategies, trigger conditions, practical test cases, and optimization tips—showing how proper compaction resolves fragmentation, improves allocation success, and boosts overall system performance.
LinuxMemory CompactionPage Migration
0 likes · 47 min read

The article explains how frequent dynamic allocations cause external and internal memory fragmentation, illustrates the problem with C++ examples, and shows that pre‑allocating a large contiguous block as a memory pool—managed via block division, free‑list tracking, and thread‑safe operations—significantly reduces fragmentation, improves allocation speed, and boosts concurrency performance.
C++Low-Level ProgrammingMultithreading
0 likes · 30 min read

This article examines why vLLM experiences out‑of‑memory errors in production, explains memory fragmentation caused by PagedAttention, outlines four typical OOM scenarios with concrete command‑line solutions, and provides deep analysis, configuration scripts, dynamic tuning, troubleshooting flowcharts, monitoring alerts, and best‑practice recommendations.
GPUOOMPython
0 likes · 24 min read

This article explains why frequent dynamic memory allocation can cause slowdown and fragmentation, introduces fixed-size memory pools as an efficient solution, details their core principles, data structures, key allocation and deallocation functions, and demonstrates their performance advantage with C++ code examples and benchmarks.
C++custom allocatorfixed-size allocation
0 likes · 20 min read

This article examines the internal design of glibc’s ptmalloc, explains how malloc_state, malloc_chunk, fastbins, bins and the top chunk work, analyzes lock contention and memory fragmentation in multithreaded scenarios, and presents a C benchmark that measures these performance issues.
C++freemalloc
0 likes · 12 min read

This article explains the problem of internal and external memory fragmentation in Linux systems, introduces eBPF as a powerful tracing tool, and provides step‑by‑step guidance for building, loading, and running eBPF programs to analyze and mitigate fragmentation on both Linux and Android platforms.
AndroidBPFLinux kernel
0 likes · 22 min read

This article examines MySQL slow‑query troubleshooting, explaining how the optimizer estimates costs, why indexes may be ineffective even when present, the impact of memory fragmentation, pitfalls of prefix indexes, index merging techniques, and additional resource‑related factors that can cause seemingly healthy SQL statements to become slow.
Index OptimizationMySQLcost estimation
0 likes · 11 min read

This article explains what happens inside a computer when you request memory with malloc, covering the role of the standard library, the compilation and linking process, memory layout, heap allocation, fragmentation, and how the operating system expands the heap.
Heapc-programmingmalloc
0 likes · 6 min read

The article explains C’s memory allocation, detailing how functions like malloc obtain heap space, the role of system calls such as brk, the distinction between stack and heap, address layout, fragmentation challenges, and practical implications for efficient dynamic memory management.
Heapc-programmingmalloc
0 likes · 5 min read

Linux’s memory compaction mitigates external fragmentation by moving movable pages, employing four strategies—direct, passive (kcompactd), proactive, and active—each invoking the compact_zone core with configurable compact_control parameters, migrate‑page and free‑page scanners, and distinct trigger and exit conditions.
Linux kernelMemory CompactionPage Migration
0 likes · 45 min read

This article investigates the performance degradation caused by DPDK memory fragmentation, explains the underlying heap and element management, presents detailed profiling and test results, and proposes two practical solutions that dramatically reduce allocation latency and improve overall system throughput.
C++DPDKmalloc
0 likes · 16 min read

This article explains the problem of memory fragmentation in Linux, describes the compaction algorithm that moves free pages together, and walks through the key kernel functions—alloc_pages_node, __alloc_pages_direct_compact, try_to_compact_pages, isolate_migratepages, migrate_pages, and unmap_and_move—detailing their roles in gathering movable pages and relocating them to create contiguous memory blocks.
Linuxalloc_pageskernel
0 likes · 10 min read

This article explains why Redis may show high OS‑allocated memory despite low data usage, describes the causes of memory fragmentation, and provides practical steps—including configuration changes and automatic defragmentation settings—to diagnose and mitigate fragmentation for stable performance.
Cachingdatabasesmemory fragmentation
0 likes · 9 min read

The article analyzes a recurring one‑second pause in a Redis 4.0 master‑slave setup, identifies the periodic BGSAVE fork operation as the root cause through metrics like latest_fork_usec, and presents mitigation strategies such as memory limits, activedefrag, and migration to a lower‑RSS instance.
BGSAVEforkmemory fragmentation
0 likes · 6 min read

This article explains why a low Redis memory fragmentation ratio is not necessarily caused by swap usage, demonstrates experiments with disabled swap and varying repl‑backlog‑size, and concludes that large replication buffers and small data sets can naturally produce ratios far below 1, which is normal.
RedisReplicationSwap
0 likes · 7 min read

This article explains why Redis memory usage stays high after deleting keys, describes memory fragmentation causes, shows how to detect fragmentation with INFO memory and mem_fragmentation_ratio, and provides practical steps and configuration options to clean and prevent fragmentation.
Active DefragmentationDatabase PerformanceINFO command
0 likes · 10 min read

This article examines typical C/C++ memory problems, classifying them into memory leaks and performance issues caused by fragmentation, explains root causes such as lost pointers, improper releases, unbounded allocations, and provides diagnostic examples and mitigation strategies using memory pools like tcmalloc.
C++DebuggingTCMalloc
0 likes · 13 min read
