Tag

memory allocation

1 views collected around this technical thread.

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 ProgrammingMMAPbrk
0 likes · 17 min read
Understanding malloc and free: Memory Allocation Mechanisms in C
Refining Core Development Skills
Refining Core Development Skills
Feb 19, 2025 · Operations

Linux Kernel Memory Detection via E820 Mechanism

This article explains how the Linux kernel detects physical memory during boot by leveraging the E820 mechanism, where firmware reports memory ranges via interrupt 15H, enabling the kernel to map usable memory addresses for subsequent allocation.

E820Linux KernelMemory Management
0 likes · 8 min read
Linux Kernel Memory Detection via E820 Mechanism
Deepin Linux
Deepin Linux
Feb 14, 2025 · Fundamentals

Understanding Jemalloc: Principles, Comparisons, and Optimization Practices

This article provides a comprehensive overview of Jemalloc, covering its architecture, memory allocation fundamentals, performance comparison with ptmalloc and tcmalloc, practical optimization cases across web, database, and big‑data workloads, and detailed configuration guidelines to improve memory efficiency and multithreaded performance.

fragmentationjemallocmemory allocation
0 likes · 31 min read
Understanding Jemalloc: Principles, Comparisons, and Optimization Practices
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++dynamic memoryfree
0 likes · 32 min read
Understanding the Implementation and Mechanisms of the C malloc Function
Aikesheng Open Source Community
Aikesheng Open Source Community
Aug 8, 2024 · Databases

Understanding LOG_DISK Resource Limits and Tenant Memory Allocation in OceanBase

This article analyzes why creating a resource pool with 4C12G fails in an OceanBase single‑node cluster despite sufficient CPU and memory, explains the relationship between LOG_DISK size and tenant memory, provides calculation formulas, verification steps, and practical recommendations to avoid LOG_DISK resource shortages.

Database AdministrationLOG_DISKOceanBase
0 likes · 11 min read
Understanding LOG_DISK Resource Limits and Tenant Memory Allocation in OceanBase
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 ProgrammingOperating Systemfragmentation
0 likes · 6 min read
Understanding Memory Allocation, Heap Layout, and Fragmentation in C
IT Services Circle
IT Services Circle
Mar 25, 2024 · Fundamentals

Greedy Interval Algorithm for Memory Allocation

The article explains a greedy interval‑based memory allocation problem, describes how to detect overlapping intervals, locate the smallest suitable free block within a 100‑byte heap, and provides a complete Python implementation that reads intervals, checks validity, and outputs the optimal allocation address.

Pythonalgorithmic problemgreedy algorithm
0 likes · 6 min read
Greedy Interval Algorithm for Memory Allocation
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++glibcheap
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 CollectionLinux
0 likes · 31 min read
Dynamic Memory Allocation, malloc/free, new/delete, and Linux Memory Management Overview
37 Interactive Technology Team
37 Interactive Technology Team
Nov 20, 2023 · Fundamentals

What Are Stack and Heap?

The article explains Go’s stack and heap memory, showing that stack allocations are fast, LIFO‑ordered and compile‑time sized while heap allocations grow upward, require garbage collection, and occur when variables escape a function, urging developers to prefer stack use for better performance.

Garbage CollectionGoStack
0 likes · 6 min read
What Are Stack and Heap?
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.

LinuxTCMallocbenchmark
0 likes · 32 min read
Analysis and Comparison of ptmalloc and tcmalloc Memory Allocators on Linux
政采云技术
政采云技术
Sep 7, 2023 · Backend Development

Understanding Netty's Memory Management and Allocation Strategies

This article explains how Netty implements memory management by borrowing concepts from Jemalloc and Tcmalloc, detailing the hierarchy of arenas, chunks, pages and sub‑pages, the allocation algorithms for both large and small buffers, and the role of thread‑local caches in reducing fragmentation and improving performance.

JavaMemory ManagementNetty
0 likes · 24 min read
Understanding Netty's Memory Management and Allocation Strategies
ByteDance SYS Tech
ByteDance SYS Tech
May 26, 2023 · Fundamentals

Unlock Faster C++ Performance: Practical Jemalloc Optimization Techniques

This article explains the fundamentals of Linux memory allocation, introduces Jemalloc’s core algorithms and data structures, and provides concrete optimization steps—including arena tuning, tcache configuration, and slab size adjustments—to achieve measurable CPU savings in high‑concurrency C++ services.

C++Linuxarena
0 likes · 19 min read
Unlock Faster C++ Performance: Practical Jemalloc Optimization Techniques
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.

Runtimedlmallocjemalloc
0 likes · 27 min read
In‑Depth Analysis of dlmalloc, jemalloc, Scudo, and PartitionAlloc for Virtual‑Machine Memory Management
Refining Core Development Skills
Refining Core Development Skills
Apr 1, 2022 · Fundamentals

Stack vs Heap Memory Allocation: Speed Comparison and Implementation Details

This article explains how memory allocation on the stack is faster than on the heap, demonstrates the process with assembly instructions, provides benchmark code comparing allocation speeds, discusses compiler optimizations, and outlines the differences, advantages, and pitfalls of stack and heap memory usage.

C++Compiler OptimizationStack
0 likes · 9 min read
Stack vs Heap Memory Allocation: Speed Comparison and Implementation Details
Baidu Intelligent Testing
Baidu Intelligent Testing
Jul 22, 2021 · Backend Development

Performance Optimization Techniques for Baidu C++ Backend Services: Memory Access, Allocation, and Concurrency

This article presents a comprehensive collection of Baidu C++ engineers' performance‑optimization practices, covering memory‑access patterns, string handling, protobuf manipulation, allocator choices, job‑level memory arenas, cache‑line considerations, and memory‑order semantics to achieve substantial latency and cost reductions in large‑scale backend services.

C++backend developmentconcurrency
0 likes · 32 min read
Performance Optimization Techniques for Baidu C++ Backend Services: Memory Access, Allocation, and Concurrency
Tencent Cloud Developer
Tencent Cloud Developer
Jun 3, 2021 · Backend Development

Understanding Go's Memory Allocation: From Assembly Debugging to Runtime Components

The article walks through Go’s memory allocator by first demonstrating assembly‑level debugging with Delve, then detailing its TCMalloc‑inspired design where tiny, small, and large objects follow distinct paths through per‑P caches, central spans, and the global heap, highlighting the roles of mcache, mcentral, mspan, and mheap.

GCGoRuntime
0 likes · 28 min read
Understanding Go's Memory Allocation: From Assembly Debugging to Runtime Components
High Availability Architecture
High Availability Architecture
Apr 29, 2021 · Backend Development

C++ Backend Performance Optimization at Baidu: Memory Access, Allocation, and Concurrency Techniques

This article shares Baidu C++ engineers' practical performance‑optimisation techniques, covering memory‑access patterns, custom allocation strategies, string handling, protobuf handling, cache‑line considerations and memory‑order semantics to achieve significant latency and cost reductions in large‑scale backend services.

C++backend developmentconcurrency
0 likes · 32 min read
C++ Backend Performance Optimization at Baidu: Memory Access, Allocation, and Concurrency Techniques
Baidu Geek Talk
Baidu Geek Talk
Apr 21, 2021 · Backend Development

Performance Optimization in Baidu's C++ Backend: Memory Allocation and Access Techniques

Baidu engineers boost C++ backend latency and cost efficiency by eliminating unnecessary string zero‑initialization, using zero‑copy split with SIMD, replacing deep protobuf merges with repeated string fields, employing job‑scoped arenas and custom memory resources for allocation, and applying prefetching, cache‑line awareness, and tuned memory‑order semantics, achieving multiplicative to order‑of‑magnitude speedups.

C++Memory AccessProtobuf
0 likes · 31 min read
Performance Optimization in Baidu's C++ Backend: Memory Allocation and Access Techniques
Sohu Tech Products
Sohu Tech Products
Apr 14, 2021 · Backend Development

Understanding nil in Go: Variable Definitions, Memory Allocation, and Type Behavior

This article explains the nature of Go's nil keyword, how it interacts with different types such as slices, maps, channels, interfaces, pointers and functions, and clarifies variable definition, zero‑value allocation, make versus var, and the compiler's nil handling semantics.

GoVariablesbackend
0 likes · 15 min read
Understanding nil in Go: Variable Definitions, Memory Allocation, and Type Behavior