package javafx_tests; import java.awt.FlowLayout; import javax.swing.*; public class MyComponent extends JPanel { private byte[] humongous = new byte[5000000]; public MyComponent(int count) { this.setLayout(new FlowLayout()); this.add(new JLabel("Slide # " + count)); System.out.println("#freeMemory=" + Runtime.getRuntime().freeMemory()); } }