Index: trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Geometry.java
===================================================================
--- trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Geometry.java	(revision 18184)
+++ trunk/src/org/openstreetmap/josm/data/imagery/vectortile/mapbox/Geometry.java	(revision 18185)
@@ -48,5 +48,6 @@
             int y = 0;
             // Area is used to determine the inner/outer of a polygon
-            final int maxArraySize = commands.stream().filter(command -> command.getType() != Command.ClosePath).mapToInt(command -> command.getOperations().length).sum();
+            final int maxArraySize = commands.stream().filter(command -> command.getType() != Command.ClosePath)
+                    .mapToInt(command -> command.getOperations().length).sum();
             final List<Integer> xArray = new ArrayList<>(maxArraySize);
             final List<Integer> yArray = new ArrayList<>(maxArraySize);
@@ -79,5 +80,6 @@
                     }
 
-                    final double areaAreaSq = calculateSurveyorsArea(xArray.stream().mapToInt(i -> i).toArray(), yArray.stream().mapToInt(i -> i).toArray());
+                    final double areaAreaSq = calculateSurveyorsArea(xArray.stream().mapToInt(i -> i).toArray(),
+                            yArray.stream().mapToInt(i -> i).toArray());
                     Area nArea = new Area(line);
                     // SonarLint thinks that this is never > 0. It can be.
@@ -89,4 +91,6 @@
                         throw new IllegalArgumentException(tr("{0} cannot have zero area", geometryType));
                     }
+                    xArray.clear();
+                    yArray.clear();
                 } else {
                     throw new IllegalArgumentException(tr("{0} with {1} arguments is not understood", geometryType, operations.length));
