A Deep Dive Into Memory

Dynamic memory allocation functions like malloc(), calloc(), realloc(), and free() are crucial in programming. The improved version, dlmalloc(), is widely adopted due to its efficiency. When called, these functions trigger system calls like brk()/sbrk() and mmap() to allocate memory. Understanding these processes is essential for efficient memory management in programming.

Read More A Deep Dive Into Memory

Memory Allocators PART-II

The “Best Fit” strategy in memory allocation finds the closest match, reducing wasted memory and working well with diverse request sizes. However, it can lead to increased fragmentation over time. While efficient, it may result in many tiny, unusable spaces in memory, posing a trade-off between immediate efficiency and potential long-term fragmentation.

Read More Memory Allocators PART-II

Memory Allocators PART-I

Memory allocation in embedded systems is crucial due to limited memory. Different algorithms like Sequential Fits, Best Fit, First Fit, Next Fit, Good Fit, Segregated Free Lists, Segregated Fits, Buddy System, Indexed Fits, and Bitmapped Fits optimize memory use based on various requirements. Each approach has its pros and cons, making them suitable for different scenarios.

Read More Memory Allocators PART-I