Changeset 11021 in josm for trunk


Ignore:
Timestamp:
2016-09-18T15:56:38+02:00 (8 years ago)
Author:
Don-vip
Message:

clear image provider cache before/after integration tests. The previous Jenkins job heap dump revealed it contained 14.000 entries and consumed up to 3Gb of memory

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r10895 r11021  
    766766
    767767    /**
     768     * Clears the internal image cache.
     769     * @since 11021
     770     */
     771    public static void clearCache() {
     772        synchronized (cache) {
     773            cache.clear();
     774        }
     775    }
     776
     777    /**
    768778     * Internal implementation of the image request.
    769779     *
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/MapPaintPreferenceTestIT.java

    r10994 r11021  
    2424import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource;
    2525import org.openstreetmap.josm.gui.preferences.SourceEditor.ExtendedSourceEntry;
     26import org.openstreetmap.josm.tools.ImageProvider;
    2627
    2728import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
     
    5354    @Test
    5455    public void testValidityOfAvailableStyles() throws Exception {
     56        ImageProvider.clearCache();
    5557        Collection<ExtendedSourceEntry> sources = new MapPaintPreference.MapPaintSourceEditor()
    5658                .loadAndGetAvailableSources();
     
    9799            }
    98100        }
     101        ImageProvider.clearCache();
    99102        assertTrue(allErrors.toString()+"\n"+allWarnings.toString(), allErrors.isEmpty() && allWarnings.isEmpty());
    100103    }
  • trunk/test/unit/org/openstreetmap/josm/gui/preferences/map/TaggingPresetPreferenceTestIT.java

    r10994 r11021  
    2020import org.openstreetmap.josm.gui.tagging.presets.TaggingPreset;
    2121import org.openstreetmap.josm.gui.tagging.presets.TaggingPresetReader;
     22import org.openstreetmap.josm.tools.ImageProvider;
    2223import org.xml.sax.SAXException;
    2324
     
    5051    @Test
    5152    public void testValidityOfAvailablePresets() throws Exception {
     53        ImageProvider.clearCache();
    5254        Collection<ExtendedSourceEntry> sources = new TaggingPresetPreference.TaggingPresetSourceEditor()
    5355                .loadAndGetAvailableSources();
     
    8486            }
    8587        }
     88        ImageProvider.clearCache();
    8689        assertTrue(allErrors.toString(), allErrors.isEmpty());
    8790        assertTrue(allMessages.toString(), allMessages.isEmpty());
Note: See TracChangeset for help on using the changeset viewer.