private void forceOutOfMemory(){
  ArrayList junk=new ArrayList();
  for (; ; ) {
    junk.add(new long[100000]);
  }
}

private void forceOutOfMemory ( ) { ArrayList junk = new ArrayList ( ) ; for ( ; ; ) { junk . add ( new long [ 100000 ] ) ; } }
allocate objects until death
