Sign in to follow this  
Pooya65

fast memory manager

Recommended Posts

hello

 

i want a fast memory allocation library or alogritm  that supports multithreading ( before it i try some library like as ned malloc and doug lea). are u know any other library or alogrithm ?

Share this post


Link to post
Share on other sites

A general purpose allocator will usually be slower than something written specifically for the problem you have, because you can use knowledge of the allocation pattern to speed it up.

 

For example if you can avoid allocating memory one one thread, and freeing it on another you can save on a bunch of expensive synchronization by giving each thread it's own heap.

Share this post


Link to post
Share on other sites

Intel TBB, http://threadingbuildingblocks.org/, has some potentially useful building blocks: http://threadingbuildingblocks.org/docs/doxygen/a00426.html

 

For example, take a look at the "Multi-threaded memory allocators" section in the "Optimizing Game Architectures" article:

http://software.intel.com/en-us/articles/optimizing-game-architectures-with-intel-threading-building-blocks

Edited by Matt-D

Share this post


Link to post
Share on other sites

hello

 

i want a fast memory allocation library or alogritm  that supports multithreading ( before it i try some library like as ned malloc and doug lea). are u know any other library or alogrithm ?

 

Is memory allocation actually causing a bottleneck in your code, or do you just want to drop in a different memory allocator for the sake of having one?

If memory allocation actually is causing performance problems you should first have a look at how you are allocating and freeing memory throughout your code.

 

Are you doing a lot of (small) allocations which get freed right afterwards?

Could you maybe remove some free store allocations in favor of stack allocations?

Is there a possibility of allocating a bunch of memory up front an re-using this pool of memory throughout your application?

 

Always try to look for solutions to your problems higher up before you try to mess with these lower level mechanics, you might be causing more problems than you're solving.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this