Replies: 3 comments
-
Beta Was this translation helpful? Give feedback.
-
|
Using mmap as we do gives you a precisely known resident set size and guaranteed zero fragmentation. This is needed for running inside a fixed resource envelope. Also, you know how much memory you actually are holding. The same is not true of malloc. But there is also a malloc based variant of the functions. Of course if you use malloc then malloc keeps its free lists etc and you in general would not be performing this function. There are a couple of instances of more complex objects (consisting of multiple pieces of memory), like vectors, being recycled, e.g. VectorPool. |
Beta Was this translation helpful? Give feedback.
-
|
Thx, I am clear about why you use mmap. What about memory reuse? From what I see, your memory management behaves like this when user requests new memory allocation. Standard MemoryUse MappedMemory
Your memory pool use these 2 for memory allocation and free, but seems that I dont see any memory reuse here ? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
First of all, great project guys! But 2 things about MemoryPool implementation confuse me a little bit.
Seems that you dont actually reuse the already allocated pages but choose to malloc new pages everytime when you call
MemoryPoolImpl::alloctewhy you choose to use mmap for memory pool implementation? Any reason behind this choice?
Beta Was this translation helpful? Give feedback.
All reactions