Tag

malloc

1 views collected around this technical thread.

IT Services Circle
IT Services Circle
Jun 8, 2025 · Information Security

Why mmap Shared Memory Is More Dangerous Than malloc – Risks Explained

mmap shared memory lets multiple processes access the same physical memory, which can break process isolation, expose permission misconfigurations like PROT_EXEC, and cause cross‑process crashes or code‑injection attacks, making it far riskier than heap allocations with malloc that remain confined to a single process.

C programmingMMAPmalloc
0 likes · 5 min read
Why mmap Shared Memory Is More Dangerous Than malloc – Risks Explained
Deepin Linux
Deepin Linux
Jun 6, 2025 · Fundamentals

Unlocking Linux Memory Management: From malloc to Buddy Allocation

This comprehensive guide explores Linux's memory management ecosystem, detailing user‑space allocators like malloc, kernel‑space mechanisms such as kmalloc, vmalloc, and mmap, and core kernel algorithms including the Buddy system, CMA, slab allocator, and memory pools, while providing code examples and practical usage tips.

Buddy AlgorithmMMAPMemory Management
0 likes · 60 min read
Unlocking Linux Memory Management: From malloc to Buddy Allocation
Deepin Linux
Deepin Linux
May 29, 2025 · Fundamentals

Understanding glibc Heap Memory Management: Architecture, Mechanisms, and Exploitation

This article provides a comprehensive overview of glibc's heap memory management, explaining the role of brk and mmap, the organization of arenas, heaps, chunks, bin structures, allocation and deallocation strategies, and how these concepts are applied in security research and exploit development.

C++Memory Managementfree
0 likes · 29 min read
Understanding glibc Heap Memory Management: Architecture, Mechanisms, and Exploitation
Deepin Linux
Deepin Linux
May 28, 2025 · Fundamentals

Understanding Heap Memory Management in C: Detailed Guide to malloc and free

This article provides a comprehensive overview of heap memory management in C, explaining the concepts of heap versus stack, the usage and internal mechanisms of malloc and free, common pitfalls such as memory leaks and dangling pointers, and compares these functions with new/delete, calloc, and realloc.

C++HeapMemory Management
0 likes · 29 min read
Understanding Heap Memory Management in C: Detailed Guide to malloc and free
Deepin Linux
Deepin Linux
May 28, 2025 · Fundamentals

Understanding glibc malloc: Overview, Mechanisms, and Optimization Techniques

This article explains the role of glibc malloc in dynamic memory allocation, describes its internal data structures and allocation/free algorithms, provides a C code example, and offers practical optimization tips and common pitfalls for safe and efficient memory management.

C programmingMemory ManagementPerformance Optimization
0 likes · 13 min read
Understanding glibc malloc: Overview, Mechanisms, and Optimization Techniques
Deepin Linux
Deepin Linux
May 1, 2025 · Fundamentals

Understanding Memory and Process Interaction: Virtual Memory, Paging, and Allocation in Linux

This article explains how memory works as a temporary storage stage for processes, describes the fundamentals of physical and virtual memory, details paging, page tables, multi‑level paging, allocation mechanisms such as brk() and mmap(), and outlines Linux memory‑management techniques including caching, swapping, and OOM handling.

MMUMemory ManagementPaging
0 likes · 33 min read
Understanding Memory and Process Interaction: Virtual Memory, Paging, and Allocation in Linux
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 programmingHeapMMAP
0 likes · 17 min read
Understanding malloc and free: Memory Allocation Mechanisms in C
Deepin Linux
Deepin Linux
Dec 19, 2024 · Fundamentals

Understanding the Implementation and Mechanisms of the C malloc Function

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++Memory Allocationdynamic memory
0 likes · 32 min read
Understanding the Implementation and Mechanisms of the C malloc Function
IT Services Circle
IT Services Circle
Jun 29, 2024 · Fundamentals

Understanding Memory Allocation, Heap Layout, and Fragmentation in C

This article explains how memory allocation works in C, covering the role of malloc, the distinction between code and user data, the compilation and linking process, heap organization, fragmentation, and how the operating system expands the heap when needed.

C programmingHeapMemory Allocation
0 likes · 6 min read
Understanding Memory Allocation, Heap Layout, and Fragmentation in C
Java Tech Enthusiast
Java Tech Enthusiast
Jun 29, 2024 · Fundamentals

Understanding Memory Allocation in C

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.

C programmingHeapMemory Management
0 likes · 5 min read
Understanding Memory Allocation in C
Refining Core Development Skills
Refining Core Development Skills
Jan 23, 2024 · Fundamentals

Deep Dive into the Internal Working of malloc and the ptmalloc Memory Allocator

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.

C++HeapMemory Allocation
0 likes · 14 min read
Deep Dive into the Internal Working of malloc and the ptmalloc Memory Allocator
Deepin Linux
Deepin Linux
Dec 6, 2023 · Fundamentals

Dynamic Memory Allocation, malloc/free, new/delete, and Linux Memory Management Overview

This article explains the principles and usage of dynamic memory allocation in C/C++ (malloc, calloc, realloc, free, new, delete), compares their behaviors, demonstrates common pitfalls, and extends the discussion to Linux kernel memory statistics, cache handling, swappiness tuning, and garbage‑collection concepts.

C++Garbage CollectionMemory Allocation
0 likes · 31 min read
Dynamic Memory Allocation, malloc/free, new/delete, and Linux Memory Management Overview
Deepin Linux
Deepin Linux
Nov 20, 2023 · Fundamentals

Linux Memory Allocation Mechanisms: malloc, kmalloc, vmalloc, mmap, and Slab

This article explains Linux's flexible memory allocation system, covering user‑space malloc, kernel‑space kmalloc, vmalloc for large buffers, mmap for file and anonymous mappings, page allocation functions, the slab allocator, and memory pools, with detailed code examples and operational insights.

MMAPMemory ManagementSlab Allocator
0 likes · 30 min read
Linux Memory Allocation Mechanisms: malloc, kmalloc, vmalloc, mmap, and Slab
Zhuanzhuan Tech
Zhuanzhuan Tech
Sep 14, 2023 · Fundamentals

Analysis and Comparison of ptmalloc and tcmalloc Memory Allocators on Linux

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.

BenchmarkMemory AllocationPerformance
0 likes · 32 min read
Analysis and Comparison of ptmalloc and tcmalloc Memory Allocators on Linux
ByteDance SYS Tech
ByteDance SYS Tech
May 19, 2023 · Backend Development

Why DPDK Memory Allocation Slows Down and How to Fix It

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++DPDKPerformance Optimization
0 likes · 16 min read
Why DPDK Memory Allocation Slows Down and How to Fix It
Baidu Geek Talk
Baidu Geek Talk
Dec 16, 2022 · Fundamentals

Exploring ptmalloc: Memory Management in Linux C++ Programs

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++Memory Managementfree
0 likes · 12 min read
Exploring ptmalloc: Memory Management in Linux C++ Programs
ByteDance Web Infra
ByteDance Web Infra
Aug 19, 2022 · Fundamentals

In‑Depth Analysis of dlmalloc, jemalloc, Scudo, and PartitionAlloc for Virtual‑Machine Memory Management

This article examines the design goals, key implementation details, strengths and weaknesses of four widely used memory allocators—dlmalloc, jemalloc, Scudo, and PartitionAlloc—highlighting how they address fragmentation, performance, and security in virtual‑machine runtimes and offering guidance for building efficient, safe allocators.

Memory Allocationdlmallocjemalloc
0 likes · 27 min read
In‑Depth Analysis of dlmalloc, jemalloc, Scudo, and PartitionAlloc for Virtual‑Machine Memory Management
Baidu App Technology
Baidu App Technology
Jul 12, 2022 · Mobile Development

Large Memory Allocation Monitoring Solution for iOS Applications

A low‑overhead monitoring solution for iOS apps resets the global malloc_logger to capture every allocation, filters large allocations exceeding a configurable threshold, records lightweight stack traces using dyld image maps, and sends address‑only data for offline symbolication, enabling developers to identify and fix memory‑heavy code, reducing OOM crashes.

PerformanceiOSmalloc
0 likes · 14 min read
Large Memory Allocation Monitoring Solution for iOS Applications
Baidu Intelligent Testing
Baidu Intelligent Testing
Jun 14, 2016 · Fundamentals

Analysis of Common C/C++ Memory Issues: Leaks and Performance Degradation

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++Memory LeakPerformance
0 likes · 13 min read
Analysis of Common C/C++ Memory Issues: Leaks and Performance Degradation