I get the following exception when trying to run my program: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOf(Arrays.java:3210) at java.util.Arrays.copyOf(Arrays.java:3181) at java.util.ArrayList.grow(ArrayList.java:265) at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:239) at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:231) at java.util.ArrayList.add(ArrayList.java:479) at com.codegym.task.task07.task0717.Solution.doubleValues(Solution.java:33) at com.codegym.task.task07.task0717.Solution.main(Solution.java:23) After some googling I learned that this has something to do with the Garbage Collector not being able to delete object and thus the program running out of memory. But how can that happen with such a small program? Is there something wrong with my code?