add check for same cache size

This commit is contained in:
Vitaliy 2021-04-12 15:03:43 +03:00
parent fe40ec722d
commit b1ba628987

View file

@ -308,7 +308,7 @@ public class ResourceManager {
maxCacheSize += layerTiles;
}
long freeMemory = Runtime.getRuntime().freeMemory() / (1024 * 1024L);
if (freeMemory > 0 || maxCacheSize < bitmapTilesCache.getMaxCacheSize()) {
if (maxCacheSize != bitmapTilesCache.getMaxCacheSize() && (freeMemory > 0 || maxCacheSize < bitmapTilesCache.getMaxCacheSize())) {
log.info("Bitmap tiles to load in memory : " + maxCacheSize);
bitmapTilesCache.setMaxCacheSize(maxCacheSize);
}