| 107 | |
| 108 | template <typename AllocatorT> |
| 109 | size_t ObjectCacheSizeController<AllocatorT>::getTotalObjSizeBytes() const { |
| 110 | auto totalObjSize = objCache_.getTotalObjectSize(); |
| 111 | if (objCache_.config_.fragmentationTrackingEnabled && |
| 112 | folly::usingJEMalloc()) { |
| 113 | auto [jemallocAllocatedBytes, jemallocActiveBytes] = |
| 114 | trackJemallocMemStats(); |
| 115 | // proportionally add Jemalloc external fragmentation bytes (i.e. |
| 116 | // jemallocActiveBytes - jemallocAllocatedBytes) |
| 117 | totalObjSize = static_cast<size_t>( |
| 118 | 1.0 * totalObjSize / jemallocAllocatedBytes * jemallocActiveBytes); |
| 119 | } |
| 120 | return totalObjSize; |
| 121 | } |
| 122 | |
| 123 | template <typename AllocatorT> |
| 124 | void ObjectCacheSizeController<AllocatorT>::work() { |
nothing calls this directly
no test coverage detected