From 3dbee7853849eca93d80c3ddd1339aad8b5fe560 Mon Sep 17 00:00:00 2001 From: IreuN Date: Mon, 9 Dec 2024 20:51:20 +0100 Subject: [PATCH] Fix memory 'leak' (fix #240) --- .../mapillary/gui/layer/geoimage/MapillaryImageEntry.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java index 2c165a110..8b8867938 100644 --- a/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java +++ b/src/main/java/org/openstreetmap/josm/plugins/mapillary/gui/layer/geoimage/MapillaryImageEntry.java @@ -70,6 +70,7 @@ import org.openstreetmap.josm.plugins.mapillary.utils.MapillarySequenceUtils; import org.openstreetmap.josm.plugins.mapillary.utils.MapillaryUtils; import org.openstreetmap.josm.plugins.mapillary.utils.OffsetUtils; +import org.openstreetmap.josm.spi.preferences.Config; import org.openstreetmap.josm.tools.ExifReader; import org.openstreetmap.josm.tools.JosmRuntimeException; import org.openstreetmap.josm.tools.Logging; @@ -83,8 +84,8 @@ */ public class MapillaryImageEntry implements IImageEntry, BiConsumer>> { - private static final CacheAccess CACHE = JCSCacheManager - .getCache("mapillary:mapillaryimageentry"); + private static final CacheAccess CACHE = + JCSCacheManager.getCache("mapillary:mapillaryimageentry", Config.getPref().getInt("mapillary.jcs.cache.max_objects_in_memory", 10), 0, null); private static final String MESSAGE_SEPARATOR = " — "; private INode image; private final List> imageDetections = new ArrayList<>();