# memory-pool **Repository Path**: karmvs/memory-pool ## Basic Information - **Project Name**: memory-pool - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 1 - **Forks**: 0 - **Created**: 2021-04-21 - **Last Updated**: 2024-05-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # memory-pool ### Problem statement Currently we are creating fixed size buffers and keep return once allocate is called. Each allocation requires a global lock which is becoming a performance bottle neck when we have large number of concurrent requests. ### Possible Solution We have been exploring different possible solutions. One of the approaches here is by performing a lock slicing. When the operator is initialized we got to MemoryPool manager to get a pool of buffers which are specific to that particular query. If there is no pool for this query i.e the query is retrieving first page a child buffer pool is created from the global pool created. The child buffer pool is kept till the lifecycle of the Query and after that all the buffer are returned back to global pool. Buffers are never release only the bytes are zeroed. ![Memory Pool design](https://images.gitee.com/uploads/images/2021/0421/082612_77260acf_7696292.png "memoryPool.png")