Re: gslice allocator: general impresions.



Dear Tim

> > (I have modified gslice
> > to align a chunk to its own size so that I don't have unused memory
> > between chunks eg: request 20 and get 24...)
>
> you mean you've set P2ALIGNMENT to 1 * sizeof(void*) to get better
> granularity of the slices? have you left NATIVE_MALLOC_PADDING at
> 2*sizeof(void*) at least? (if not, memory fragmentation on some glibc
> systems and on all 64bit systems can become etxremely bad).
>
I didn't change P2ALIGNMENT .
I modified SLAB_INDEX to (asize - 1), SLAB_CHUNK_SIZE to (ix + 1)
I also modified P2ALIGN to (size) for all occurances of  P2ALIGN  except for 
SLAB_INFO_SIZE. I understand that this will create different memory pools for 
each size I alloc for, but this is accpeted since I only call g_slice_alloc 
for two sizes. The tweak seem to be OK since I don't get any segfaults.

> maybe due to your alignment tweaks. but maybe also because some malloc()
> buckets will have even longer lists that way.
>
The slowdown also occurred without the alignment tweaks.  My understanding is 
that it is a general malloc slowdown that occurres of the many small mallocs 
done in the application plus the many larger mallocs done by the gslice 
allocator.

I have read the references available in the gslice allocator comments and were 
very helpful. What I am looking for know is some sort of comparisons in 
memory usage and speed in applications changing from malloc to gslice. Also, 
any tweaks in the gslice allocation sizes providing a more responsive malloc 
would be great!  Any suggestions would be very welcome.

Thank you very much.

Michalis

-- 
Michalis Giannakidis



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]