public static long estimateMapCost ( long size , boolean ordered , boolean usesCachedQueryableEntries ) { long mapCost ; if ( ordered ) { mapCost = BASE_CONCURRENT_SKIP_LIST_MAP_COST + size * CONCURRENT_SKIP_LIST_MAP_ENTRY_COST ; } else { mapCost = BASE_CONCURRENT_HASH_MAP_COST + size * CONCURRENT_HASH_MAP_ENTRY_COST ; } long queryableEntriesCost ; if ( usesCachedQueryableEntries ) { queryableEntriesCost = size * CACHED_QUERYABLE_ENTRY_COST ; } else { queryableEntriesCost = size * QUERY_ENTRY_COST ; } return mapCost + queryableEntriesCost ; }
Estimates the on - heap memory cost of a map backing an index .