Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Fixes #11371 - Review ArrayByteBufferPool eviction. * Eviction is now performed on release(), rather than acquire(). * Memory accounting is done on release(), rather than acquire(). This is because we were always exceeding the memory usage on acquire(), by returning a non-pooled buffer. We only need to account for what is idle in the pool, and that is done more efficiently on release(), and it is leak-resistant (i.e. if the buffer is not returned, the memory is already non accounted for, keeping the pool consistent). * Released entries now give precedence to Concurrent.Entry, rather than Queued.Entry, so the queued pool is always kept at minimum size. * Changed eviction algorithm to be simpler: one pass through the buckets excluding the current, trying to remove idle buffers until enough memory is recovered. If successful, the buffer being released is pooled, otherwise it is also discarded. * Added detailed statistics to ArrayByteBufferPool.RetainedBuckets. * Added statisticsEnabled property in Jetty module bytebufferpool.mod. Signed-off-by: Simone Bordet <simone.bordet@gmail.com>
- Loading branch information