@@ -0,0 +1,1129 @@
+/*%0A * #%25L%0A * ImageJ interactive debugging tutorials.%0A * %25%25%0A * Copyright (C) 2009 - 2015 Board of Regents of the University of Wisconsin-Madison%0A * %25%25%0A * To the extent possible under law, the ImageJ developers have waived%0A * all copyright and related or neighboring rights to this tutorial code.%0A * %0A * See the CC0 1.0 Universal license for details:%0A * http://creativecommons.org/publicdomain/zero/1.0/%0A * #L%25%0A */%0A%0Apackage net.imagej.trouble.visible;%0A%0Aimport net.imagej.trouble.hidden.ObjectMaker;%0A%0A/**%0A * Exercise 7: Looking for memory leaks to identify the cause of%0A * %7B@link OutOfMemoryError%7D exceptions.%0A *%0A * @author Mark Hiner %3Chinerm@gmail.com%3E%0A */%0Apublic class E7InvestigateImpressions %7B%0A%0A%09public static void main(final String... args) %7B%0A%0A%09%09final int size = Math.abs((int) Runtime.getRuntime().totalMemory() / 10);%0A%0A%09%09// create 100 arrays of the determined size%0A%09%09// One of these may be a problem... but which?%0A%09%09for (int i = 0; i %3C 100; i++) %7B%0A%09%09%09System.out.println(ObjectMaker.getFloatArray(size));%0A%09%09%09System.out.println(ObjectMaker.getLongArray(size));%0A%09%09%09System.out.println(ObjectMaker.getDoubleArray(size));%0A%09%09%7D%0A%09%7D%0A%7D%0A

Create Exercise 7