public static void gc(){
  if (startedGc) {
    forceGc=true;
    gcShouldLoop=true;
  }
  startGCThread();
synchronized (LOCK) {
    LOCK.notify();
  }
  try {
    Thread.sleep(2);
  }
 catch (  InterruptedException er) {
  }
}

public static void gc ( ) { if ( startedGc ) { forceGc = true ; gcShouldLoop = true ; } startGCThread ( ) ; synchronized ( LOCK ) { LOCK . notify ( ) ; } try { Thread . sleep ( 2 ) ; } catch ( InterruptedException er ) { } }
runs the garbage collector . calling the gc method suggests that the java virtual machine expend effort toward recycling unused objects in order to make the memory they currently occupy available for quick reuse . when control returns from the method call , the java virtual machine has made a best effort to reclaim space from all discarded objects . the call system . gc ( ) is effectively equivalent to the call : runtime . getruntime ( ) . gc ( )
