diff --git a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java index eccd49f16a..8808b04e7b 100644 --- a/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java +++ b/OsmAnd/src/net/osmand/plus/resources/AsyncLoadingThread.java @@ -41,9 +41,11 @@ public class AsyncLoadingThread extends Thread { while (true) { try { updateBitmapTilesCache(); + int cacheCounter = 0; boolean tileLoaded = false; boolean mapLoaded = false; while (!requests.isEmpty()) { + cacheCounter++; Object req = requests.pop(); if (req instanceof TileLoadDownloadRequest) { TileLoadDownloadRequest r = (TileLoadDownloadRequest) req; @@ -58,6 +60,10 @@ public class AsyncLoadingThread extends Thread { } } } + if (cacheCounter == 10) { + cacheCounter = 0; + updateBitmapTilesCache(); + } } if (tileLoaded || mapLoaded) { // use downloader callback