Thanks for the slabs

So I wanted to title this post “Thanks for the memories” but I wanted a play on words to make an otherwise pretty boring subject more interesting.

I have been recently working on a project (more on that in a later post) which places heavy demands on the linux memory allocator (logical since I am developing on linux.)

I had originally developed my own memory allocator for this project a long, long time ago when memory allocation was an expensive operation and it was better to allocate large extents of memory and sub-allocate from that. The memory allocator I developed was fast but wasteful. The waste was not a major issue since I only needed to allocate lots of memory for short periods of time.

Recently I had the opportunity to revisit this and found that the memory allocator on linux was fast enough for my needs and was more efficient than mine to boot (which was not difficult.) So I dumped mine and am just using the regular memory allocator supplied in linux.

I also recently came across this interesting article in the IBM Developer Works which explains how the memory allocator in linux work. The article takes a very high level view of the slab memory allocator in linux, but provides a good starting point for greater exploration. Definitely not the for the technically challenged.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: