Changeset 8659 in josm for trunk/src/org/openstreetmap/josm/gui
- Timestamp:
- 2015-08-12T23:10:17+02:00 (9 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/AbstractCachedTileSourceLayer.java
r8647 r8659 36 36 */ 37 37 public static final IntegerProperty MAX_DISK_CACHE_SIZE = new IntegerProperty(PREFERENCE_PREFIX + "max_disk_size", 512); 38 39 /**40 * use fairly small memory cache, as cached objects are quite big, as they contain BufferedImages41 */42 public static final IntegerProperty MEMORY_CACHE_SIZE = new IntegerProperty(PREFERENCE_PREFIX + "cache.max_objects_ram", 200);43 38 44 39 private ICacheAccess<String, BufferedImageCacheEntry> cache; -
trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java
r8648 r8659 134 134 public boolean showErrors; 135 135 136 protected TileCache tileCache; 136 /** 137 * use fairly small memory cache, as cached objects are quite big, as they contain BufferedImages 138 */ 139 public static final IntegerProperty MEMORY_CACHE_SIZE = new IntegerProperty(PREFERENCE_PREFIX + "cache.max_objects_ram", 200); 140 141 /* 142 * use MemoryTileCache instead of tileLoader JCS cache, as tileLoader caches only content (byte[] of image) 143 * and MemoryTileCache caches whole Tile. This gives huge performance improvement when a lot of tiles are visible 144 * in MapView (for example - when limiting min zoom in imagery) 145 * 146 * Use static instance so memory is shared between layers to prevent out of memory exceptions, when user is working with many layers 147 */ 148 protected static TileCache tileCache = new MemoryTileCache(MEMORY_CACHE_SIZE.get()); 137 149 protected AbstractTMSTileSource tileSource; 138 150 protected TileLoader tileLoader; … … 174 186 175 187 tileLoader = getTileLoaderFactory().makeTileLoader(this, headers); 176 /*177 * use MemoryTileCache instead of tileLoader JCS cache, as tileLoader caches only content (byte[] of image)178 * and MemoryTileCache caches whole Tile. This gives huge performance improvement when a lot of tiles are visible179 * in MapView (for example - when limiting min zoom in imagery)180 */181 tileCache = new MemoryTileCache(AbstractCachedTileSourceLayer.MEMORY_CACHE_SIZE.get());182 188 183 189 try {
Note:
See TracChangeset
for help on using the changeset viewer.