Example #1
0
 private void autoClean() {
   float percent = PropertyUtil.getPropertyFloat("CLEANER_AUTO_RUN_MEM_PERCENT");
   if (percent >= 1 || percent <= 0) {
     return;
   }
   Runtime rt = Runtime.getRuntime();
   if ((rt.totalMemory() - rt.freeMemory()) / (double) rt.maxMemory() > percent) {
     System.out.println("run auto clean...");
     cleaner.wakeup();
   }
 }