package Coba.DoesNotTerminate; import java.util.*; /** * This will keep generating objects to fill the heap. */ public class SpamHeap { private long x1 = 1 ; private long x2 = 2 ; private long x3 = 3 ; private long x4 = 4 ; private long x5 = 5 ; public SpamHeap() { } public int spam() { try { int k = 0 ; List z = new LinkedList() ; while(k>=0) { k++ ; z.add(new SpamHeap()) ; k-- ; } return k ; } catch (Throwable e) { System.err.println(">>>>> " + e) ; throw e ; } } }