Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java	(revision 22761)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/GeorefImage.java	(revision 22779)
@@ -13,4 +13,5 @@
 import java.io.ObjectOutputStream;
 import java.io.Serializable;
+import java.lang.ref.SoftReference;
 
 import javax.imageio.ImageIO;
@@ -28,5 +29,5 @@
 
 	private BufferedImage image;
-	private BufferedImage reImg = null;
+	private SoftReference<BufferedImage> reImg;
 	private int xIndex;
 	private int yIndex;
@@ -51,5 +52,5 @@
 			this.yIndex = yIndex;
 			this.image = null;
-			this.reImg = null;
+			flushedResizedCachedInstance();
 		}
 	}
@@ -60,6 +61,6 @@
 
 	public void changeImage(State state, BufferedImage image) {
+		flushedResizedCachedInstance();
 		this.image = image;
-		this.reImg = null;
 		this.state = state;
 
@@ -126,6 +127,7 @@
 			return false;
 
-		if(reImg != null && reImg.getWidth() == width && reImg.getHeight() == height) {
-			g.drawImage(reImg, x, y, null);
+		BufferedImage img = reImg == null?null:reImg.get();
+		if(img != null && img.getWidth() == width && img.getHeight() == height) {
+			g.drawImage(img, x, y, null);
 			return true;
 		}
@@ -134,5 +136,5 @@
 
 		try {
-			if(reImg != null) reImg.flush();
+			if(img != null) img.flush();
 			long freeMem = Runtime.getRuntime().maxMemory() - Runtime.getRuntime().totalMemory();
 			//System.out.println("Free Memory:           "+ (freeMem/1024/1024) +" MB");
@@ -149,11 +151,12 @@
 			} else {
 				// We haven't got a saved resized copy, so resize and cache it
-				reImg = new BufferedImage(width, height, alphaChannel?BufferedImage.TYPE_INT_ARGB:BufferedImage.TYPE_3BYTE_BGR);
-				reImg.getGraphics().drawImage(getImage(),
+				img = new BufferedImage(width, height, alphaChannel?BufferedImage.TYPE_INT_ARGB:BufferedImage.TYPE_3BYTE_BGR);
+				img.getGraphics().drawImage(getImage(),
 						0, 0, width, height, // dest
 						0, 0, getImage().getWidth(null), getImage().getHeight(null), // src
 						null);
-				reImg.getGraphics().dispose();
-				g.drawImage(reImg, x, y, null);
+				img.getGraphics().dispose();
+				g.drawImage(img, x, y, null);
+				reImg = new SoftReference<BufferedImage>(img);
 			}
 		} catch(Exception e) {
@@ -164,8 +167,5 @@
 
 	private void fallbackDraw(Graphics g, Image img, int x, int y, int width, int height) {
-		if(reImg != null) {
-			reImg.flush();
-			reImg = null;
-		}
+		flushedResizedCachedInstance();
 		g.drawImage(
 				img, x, y, x + width, y + height,
@@ -195,4 +195,10 @@
 
 	public void flushedResizedCachedInstance() {
+		if (reImg != null) {
+			BufferedImage img = reImg.get();
+			if (img != null) {
+				img.flush();
+			}
+		}
 		reImg = null;
 	}
Index: applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java
===================================================================
--- applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 22761)
+++ applications/editors/josm/plugins/wmsplugin/src/wmsplugin/WMSLayer.java	(revision 22779)
@@ -61,13 +61,16 @@
 	protected MapView mv;
 	protected String resolution;
-	protected boolean stopAfterPaint = false;
 	protected int imageSize = 500;
 	protected int dax = 10;
 	protected int day = 10;
+	protected int daStep = 5;
 	protected int minZoom = 3;
+
+	protected boolean deltaChanged;
 	protected double dx = 0.0;
 	protected double dy = 0.0;
+
 	protected double pixelPerDegree;
-	protected GeorefImage[][] images = new GeorefImage[dax][day];
+	protected GeorefImage[][] images;
 	protected String baseURL;
 	protected String cookies;
@@ -152,8 +155,19 @@
 
 	public void initializeImages() {
+		GeorefImage[][] old = images;
 		images = new GeorefImage[dax][day];
+		if (old != null) {
+			for (int i=0; i<old.length; i++) {
+				for (int k=0; k<old[i].length; k++) {
+					GeorefImage o = old[i][k];
+					images[modulo(o.getXIndex(),dax)][modulo(o.getYIndex(),day)] = old[i][k];
+				}
+			}
+		}
 		for(int x = 0; x<dax; ++x) {
 			for(int y = 0; y<day; ++y) {
-				images[x][y]= new GeorefImage(this);
+				if (images[x][y] == null) {
+					images[x][y]= new GeorefImage(this);
+				}
 			}
 		}
@@ -188,4 +202,5 @@
 
 	@Override public void paint(Graphics2D g, final MapView mv, Bounds b) {
+		deltaChanged = false;
 		if(baseURL == null) return;
 		if (usesInvalidUrl && !isInvalidUrlConfirmed) return;
@@ -246,4 +261,5 @@
 
 	public void displace(double dx, double dy) {
+		deltaChanged = true;
 		this.dx += dx;
 		this.dy += dy;
@@ -278,4 +294,21 @@
 
 	protected void downloadAndPaintVisible(Graphics g, final MapView mv, boolean real){
+
+		int newDax = dax;
+		int newDay = day;
+
+		if (bmaxx - bminx >= dax || bmaxx - bminx < dax - 2 * daStep) {
+			newDax = ((bmaxx - bminx) / daStep + 1) * daStep;
+		}
+
+		if (bmaxy - bminy >= day || bmaxy - bminx < day - 2 * daStep) {
+			newDay = ((bmaxy - bminy) / daStep + 1) * daStep;
+		}
+
+		if (newDax != dax || newDay != day) {
+			dax = newDax;
+			day = newDay;
+			initializeImages();
+		}
 
 		for(int x = bminx; x<=bmaxx; ++x) {
@@ -706,4 +739,14 @@
 	}
 
+	@Override
+	public boolean isChanged() {
+		requestQueueLock.lock();
+		try {
+			return !finishedRequests.isEmpty() || deltaChanged;
+		} finally {
+			requestQueueLock.unlock();
+		}
+	}
+
 	public void preferenceChanged(PreferenceChangeEvent event) {
 		if (event.getKey().equals(WMSPlugin.PROP_SIMULTANEOUS_CONNECTIONS.getKey())) {
