void freeSoftReferences(){
  try {
    eatMemory(1);
  }
 catch (  OutOfMemoryError e) {
  }
  System.gc();
  System.gc();
  freeMemory();
}

void freeSoftReferences ( ) { try { eatMemory ( 1 ) ; } catch ( OutOfMemoryError e ) { } System . gc ( ) ; System . gc ( ) ; freeMemory ( ) ; }
eat memory so that all soft references are garbage collected .
