LWMalloc: A Lightweight Dynamic Memory Allocator for Resource-Constrained Environments
In this study, we propose LWMalloc, a lightweight dynamic memory allocator designed for resource-constrained environments. LWMalloc incorporates a lightweight data structure, a deferred coalescing (DC) policy, and dedicated small chunk pools to optimize memory allocation. The lightweight data structure minimizes metadata overhead, ensuring a compact and efficient implementation. The DC policy reduces execution overhead by postponing redundant operations until allocation, maintaining both efficiency and low-response times. Dedicated small chunk pools enable <inline-formula xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink"> <tex-math notation="LaTeX">$\mathcal {O}(1)$ </tex-math></inline-formula> allocation for small memory requests, which are common in dynamic allocation patterns, by segregating them into fixed-size pools. Experimental results using real-world applications demonstrate that LWMalloc outperforms ptmalloc, the default allocator in Linux, achieving up to 53% faster execution time and 23% lower memory usage. With a compact implementation of only 530 lines of code and a 20-KB size, significantly smaller than ptmalloc’s 4838 lines and 116 KB, LWMalloc achieves an effective balance between performance and memory efficiency, making it highly suitable for resource-constrained environments.
Authors
- Hwajung Kim
- Taehyeon Kim
Institutions
- Seoul National University of Science and Technology (KR)
Publication Details
- Journal
- IEEE Internet of Things Journal
- Published
- 2025-02-12
- DOI
- https://doi.org/10.1109/jiot.2025.3541247
- Primary Topic
- Parallel Computing and Optimization Techniques
- Type
- article
- Field-Weighted Citation Impact
- 0.00