/** * Attempt to reserve the given amount of memory with the cache Manager. * @param bytesNeeded * @return */ boolean reserveLockedMemory(long bytesNeeded) { if (cacheManager.reserve(bytesNeeded) > 0) { return true; } // Round up bytes needed to osPageSize and attempt to evict // one more more blocks to free up the reservation. bytesNeeded = cacheManager.roundUpPageSize(bytesNeeded); evictLazyPersistBlocks(bytesNeeded); return cacheManager.reserve(bytesNeeded) > 0; }