You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been using cachelib to build a swap space. I want the cache to be of a certain size based on an input parameter, and I have designed it as follows:
n here is the cache size as an input parameter. What I have noticed is that for small values of n, the allocation fails with the error
E20240526 08:58:46.625504 68212 ExceptionTracer.cpp:222] exception stack complete
terminate called after throwing an instance of 'std::invalid_argument'
what(): not enough memory for slabs
The minimum n for which I can get an allocation seems to be 150K. I was wondering if there is any lower bound to the amount of memory we can allocate?
cachelib uses slab allocator underneath. The cache size needs to be a multiple of 4MBs. (Tho you don't have to specify the exact number we'll internally round down to 4MB-aligned size). Anyway that means you need to make the cache at least 2 Slabs. (we use 1 slab for internal metadata for other slabs).
Typically I would suggest just make the cache 10 slabs or 100 slabs for testing.
Activity
therealgymmy commentedon Jun 12, 2024
cachelib uses slab allocator underneath. The cache size needs to be a multiple of 4MBs. (Tho you don't have to specify the exact number we'll internally round down to 4MB-aligned size). Anyway that means you need to make the cache at least 2 Slabs. (we use 1 slab for internal metadata for other slabs).
Typically I would suggest just make the cache 10 slabs or 100 slabs for testing.