private long usedHeapInBytes(String mapName) { long usedHeapInBytes = 0L; for (int partitionId = 0; partitionId < partitionCount; partitionId++) { usedHeapInBytes += getRecordStoreHeapCost(mapName, containers[partitionId]); } NearCache nearCache = mapNearCacheManager.getNearCache(mapName); if (nearCache != null) { NearCacheStats nearCacheStats = nearCache.getNearCacheStats(); usedHeapInBytes += nearCacheStats.getOwnedEntryMemoryCost(); } return usedHeapInBytes; }
private void addNearCacheStats(String mapName, LocalMapStatsImpl localMapStats, LocalMapOnDemandCalculatedStats onDemandStats) { NearCache nearCache = mapNearCacheManager.getNearCache(mapName); if (nearCache == null) { return; } NearCacheStats nearCacheStats = nearCache.getNearCacheStats(); localMapStats.setNearCacheStats(nearCacheStats); onDemandStats.incrementHeapCost(nearCacheStats.getOwnedEntryMemoryCost()); }
private void addNearCacheStats(String mapName, LocalMapStatsImpl localMapStats, LocalMapOnDemandCalculatedStats onDemandStats) { NearCache nearCache = mapNearCacheManager.getNearCache(mapName); if (nearCache == null) { return; } NearCacheStats nearCacheStats = nearCache.getNearCacheStats(); localMapStats.setNearCacheStats(nearCacheStats); if (NATIVE != nearCache.getInMemoryFormat()) { onDemandStats.incrementHeapCost(nearCacheStats.getOwnedEntryMemoryCost()); } }
protected long getUsedHeapInBytes(String mapName) { long heapCost = 0L; final List<Integer> partitionIds = findPartitionIds(); for (int partitionId : partitionIds) { final PartitionContainer container = mapServiceContext.getPartitionContainer(partitionId); if (container == null) { continue; } heapCost += getRecordStoreHeapCost(mapName, container); } MapContainer mapContainer = mapServiceContext.getMapContainer(mapName); if (!mapContainer.getMapConfig().isNearCacheEnabled()) { return heapCost; } MapNearCacheManager mapNearCacheManager = mapServiceContext.getMapNearCacheManager(); NearCache nearCache = mapNearCacheManager.getNearCache(mapName); NearCacheStats nearCacheStats = nearCache.getNearCacheStats(); heapCost += nearCacheStats.getOwnedEntryMemoryCost(); return heapCost; }