Search code examples
c++memorymemory-managementnumascylla

Does Seastar framwork in C++ allow users to allocate different sizes of memory in different threads?


I am learning seastar framework recently and one thing that really confuses me. The official tutorial says that memory is allocated averagely in threads(cores), but this might seem very inconvenient. Does Seastar allow users themselves to allocate memory to achieve the goal that every core has a different memory size?


Solution

  • I think what you are talking about is dividing up the memory reserved for a seastar application between its cores (shards). This is indeed automatic and each core will get an equal amount. This memory is then mlocked so the OS cannot sneakily hand it out to other processes. You can then use the usual new/delete malloc/free methods to manage your memory on each core as you see fit, but you cannot allocate more memory this way, then the amount assigned to the core you are on.