background preloader

Memory

Facebook Twitter

PJLIB Reference: Fast Memory Pool. Memory pools allow dynamic memory allocation comparable to malloc or the new in operator C++.

PJLIB Reference: Fast Memory Pool

Those implementations are not desirable for very high performance applications or real-time systems, because of the performance bottlenecks and it suffers from fragmentation issue. More... Memory pools allow dynamic memory allocation comparable to malloc or the new in operator C++. Those implementations are not desirable for very high performance applications or real-time systems, because of the performance bottlenecks and it suffers from fragmentation issue.

Advantages PJLIB's pool has many advantages over traditional malloc/new operator and over other memory pool implementations, because: unlike other memory pool implementation, it allows allocation of memory chunks of different sizes,it's very very fast. Even more, PJLIB's memory pool provides some additional usability and flexibility for applications: Performance (Note: your mileage may vary, of course. Caveats There are some caveats though! The BGET Memory Allocator. BGET is a comprehensive memory allocation package which is easily configured to the needs of an application.

The BGET Memory Allocator

BGET is efficient in both the time needed to allocate and release buffers and in the memory overhead required for buffer pool management. It automatically consolidates contiguous space to minimise fragmentation. BGET is configured by compile-time definitions, Major options include: A built-in test program to exercise BGET and demonstrate how the various functions are used. Allocation by either the “first fit” or “best fit” method. Applications of BGET can range from storage management in ROM-based embedded programs to providing the framework upon which a multitasking system incorporating garbage collection is constructed. The basic algorithm underlying BGET has withstood the test of time; more than 25 years have passed since the first implementation of this code. BGET has been implemented on the largest mainframes and the lowest of microprocessors. BGET Implementation Assumptions. SMARTALLOC: Smart Memory Allocation With Checking. Smart Memory Allocation With Orphaned Buffer Detection Few things are as embarrassing as a program that leaks, yet few errors are so easy to commit or as difficult to track down in a large, complicated program as failure to release allocated memory.

SMARTALLOC: Smart Memory Allocation With Checking

SMARTALLOC replaces the standard C library memory allocation functions with versions which keep track of buffer allocations and releases and report all orphaned buffers at the end of program execution. By including this package in your program during development and testing, you can identify code that loses buffers right when it's added and most easily fixed, rather than as part of a crisis debugging push when the problem is identified much later in the testing cycle (or even worse, when the code is in the hands of a customer). When program testing is complete, simply recompiling with different flags removes SMARTALLOC from your program, permitting it to run without speed or storage penalties.

Installing SMARTALLOC #include "smartall.h" Copying. A Memory Allocator. By Doug Lea [A German adaptation and translation of this article appears in unix/mail December, 1996.

A Memory Allocator

This article is now out of date, and doesn't reflect details of current version of malloc.] Introduction Memory allocators form interesting case studies in the engineering of infrastructure software. I started writing one in 1987, and have maintained and evolved it (with the help of many volunteer contributors) ever since. The code for this allocator has been placed in the public domain (available from and is apparently widely used: It serves as the default native version of malloc in some versions of Linux; it is compiled into several commonly available software packages (overriding the native malloc), and has been used in various PC environments as well as in embedded systems, and surely many other places I don't even know about.

I wrote the first version of the allocator after writing some C++ programs that almost exclusively relied on allocating dynamic memory. Goals Minimizing Space.