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
{{ message }}
This repository has been archived by the owner on Nov 8, 2019. It is now read-only.
To complement the manual mode of pool grow mention in the #382, the user needs the ability to tell when to call the function to increase the size of the pool.
Description
The answer to the question "How much free space is left in the pool" is difficult. One has to consider that objects are not linearly arranged in the heap, which means that there's simply no single region of free space but many small regions that are continuously being tracked by the allocator. Even if we assume that the total amount of free space is a good enough measure, counting that free space is still very time consuming and potentially racey operation. And even if we return a value, that value might be invalid right after we finish calculating, because other threads might be allocating memory.
Still, a rough estimate of free space might be useful for administrative tasks. For this purpose, we will expose a API that will return the ratio of the sum of sizes of allocated objects to the current size of the heap.
API Changes
There will be one new CTL entry points:
heap.stats.allocated_curr - the number of allocated bytes
Implementation details
The sum of sizes of allocated objects will be tracked in runtime by the means of atomic increment, and will be eventually persisted in the pool. This is a trade-off between accuracy and time complexity of the statistic gathering.
The eventual nature of the persistent statistic means that it might drift over time if crashes often happen at unfortunate times. Initially, there will be no mechanism to correct for that drift.
The text was updated successfully, but these errors were encountered:
pool size statistics
Rationale
To complement the manual mode of pool grow mention in the #382, the user needs the ability to tell when to call the function to increase the size of the pool.
Description
The answer to the question "How much free space is left in the pool" is difficult. One has to consider that objects are not linearly arranged in the heap, which means that there's simply no single region of free space but many small regions that are continuously being tracked by the allocator. Even if we assume that the total amount of free space is a good enough measure, counting that free space is still very time consuming and potentially racey operation. And even if we return a value, that value might be invalid right after we finish calculating, because other threads might be allocating memory.
Still, a rough estimate of free space might be useful for administrative tasks. For this purpose, we will expose a API that will return the ratio of the sum of sizes of allocated objects to the current size of the heap.
API Changes
There will be one new CTL entry points:
heap.stats.allocated_curr
- the number of allocated bytesImplementation details
The sum of sizes of allocated objects will be tracked in runtime by the means of atomic increment, and will be eventually persisted in the pool. This is a trade-off between accuracy and time complexity of the statistic gathering.
The eventual nature of the persistent statistic means that it might drift over time if crashes often happen at unfortunate times. Initially, there will be no mechanism to correct for that drift.
The text was updated successfully, but these errors were encountered: