chandanpasunoori / redis

Automatically exported from code.google.com/p/redis
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

[SUGGESTION] Redis memory allocator #349

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I saw that Redis uses "zmalloc" which is a simple wrapper for the system malloc 
implementation. Why Redis doesn't take advantage of faster memory allocators 
like Memory Slices [1] seen in GLib or TCMalloc [2] ?

"Memory slices provide a space-efficient and multi-processing scalable way to 
allocate equal-sized pieces of memory"

Is there anyone working on something like this ?

[1] http://library.gnome.org/devel/glib/stable/glib-Memory-Slices.html
[2] http://goog-perftools.sourceforge.net/doc/tcmalloc.html

Original issue reported on code.google.com by christia...@gmail.com on 18 Oct 2010 at 7:21

GoogleCodeExporter commented 9 years ago
Redis can use TCmalloc().
zmalloc is also very simple & small, glib is HUGE.

It doesn't make sense to depend on glib just for its alocator.
If glib is adopted, we might has well review the whole code base to adopt other 
features of the glib library..
Please provide patch and/or numbers to justify glib alocator adoption.

I vote against the usage of glib, having used it before, I find redis codebase 
small and easier to read than glib, for instance.

Original comment by miguel.filipe on 19 Nov 2010 at 10:57