Skip to content

Cachelib OS memory allocation #68

Answered by leozzx
2matttu asked this question in Q&A
Oct 17, 2021 · 2 comments · 15 replies
Discussion options

You must be logged in to vote

Hi @2matttu, thanks for reaching out.

Here is where the memory is allocated and then passed into SlabAllocator: https://github.com/facebook/CacheLib/blob/main/cachelib/allocator/CacheAllocator-inl.h#L147-L158

The memory is managed by ShmManager class, here is how it asks OS for the memory internally:
https://github.com/facebook/CacheLib/blob/main/cachelib/shm/PosixShmSegment.cpp
https://github.com/facebook/CacheLib/blob/main/cachelib/shm/SysVShmSegment.cpp

Replies: 2 comments 15 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by 2matttu
Comment options

You must be logged in to vote
15 replies
@vinser52
Comment options

@skyelves
Comment options

@vinser52
Comment options

@skyelves
Comment options

@2matttu
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
7 participants