Tagged articles
ptmalloc
12 articles · Page 1 of 1
This comprehensive guide explores Linux process heap memory layout, the inner workings of malloc and ptmalloc, common pitfalls like leaks, fragmentation and holes, and equips developers with practical tools and optimization techniques to diagnose and improve heap performance.
Linuxheap memoryptmalloc
0 likes · 76 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 examines the inner workings of glibc’s ptmalloc, explains how malloc_state, malloc_chunk, fastbins and bins manage memory, and presents a multithreaded test that reveals lock contention and fragmentation problems that make the standard malloc/free unsuitable for high‑performance scenarios.
C++freemalloc
0 likes · 13 min read

This article explains the purpose, prototype, and usage of C's malloc function, delves into its underlying implementation using free‑list mechanisms, virtual‑memory translation, system calls like brk and mmap, and compares it with related functions such as calloc, realloc and new, while providing practical code examples and best‑practice guidelines.
C++Dynamic Memoryfree
0 likes · 32 min read

The article examines a production RocksDB memory‑usage problem where two instances consumed 59 GB on a 32‑CPU, 64‑GB server, identifies glibc ptmalloc’s unreclaimed free memory as the main cause, and shows that switching to jemalloc cuts usage by roughly 25 % while improving I/O and CPU efficiency.
Linux memory managementRocksDBglibc
0 likes · 11 min read

The article examines a real‑world memory alarm in a Vivo service, explains how glibc’s ptmalloc allocator manages heap memory via brk, sbrk, and mmap, shows why freed chunks stay in bins, and recommends limiting heap growth or switching to jemalloc for faster reclamation.
Backend DevelopmentC runtimeglibc
0 likes · 20 min read

The article dissects glibc's ptmalloc implementation, explaining malloc_state, malloc_chunk, fastbins, bins, and top chunk, then analyzes lock contention and fragmentation in multithreaded scenarios through a custom stress test, and concludes with recommendations for high‑performance memory management.
Concurrencyglibchigh-performance
0 likes · 12 min read

This article explains how the glibc malloc implementation (ptmalloc) manages memory by using arenas, chunks, and various bin structures such as fastbins, smallbins, largebins, and unsorted bins, and describes the step‑by‑step allocation process performed by public_mALLOc and its helper functions.
Heapglibcmalloc
0 likes · 14 min read

This article examines Linux memory management fundamentals, explains the brk/sbrk and mmap system calls, details the internal architectures, allocation and reclamation processes of ptmalloc and tcmalloc, analyzes key configuration parameters, and presents benchmark and production‑level results that demonstrate their impact on performance and memory usage.
LinuxTCMallocbenchmark
0 likes · 32 min read

This article details how long JVM garbage‑collection pauses and glibc ptmalloc memory‑fragmentation caused container OOM kills in a hotel‑pricing system, and explains the step‑by‑step diagnosis, JVM tuning, Kubernetes health‑check adjustments, and the replacement of ptmalloc with jemalloc to eliminate the issue.
GCJVMKubernetes
0 likes · 9 min read

The article explains how glibc’s default ptmalloc allocator structures memory into main and non‑main arenas, uses chunk‑based bins (fast, unsorted, small, large) for allocation and deallocation, details its locking and OS‑interaction mechanisms, and evaluates its design trade‑offs versus modern allocators.
C++Linuxfree
0 likes · 12 min read

This article introduces common memory‑leak detection tools, explains how to analyze heap memory consumption of a C++ process using AddressSanitizer, Valgrind and the core_analyzer utility, and provides practical optimization suggestions for reducing memory bloat and fragmentation.
C++Heap Analysiscore analyzer
0 likes · 18 min read
