--- dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/afstandandenrute/AfstandAndenRuteTask.java 2016/03/29 19:49:38 2993 +++ dao/DaoAdresseVedligehold/src/main/java/dk/daoas/adressevedligehold/afstandandenrute/AfstandAndenRuteTask.java 2016/03/29 20:36:40 2994 @@ -85,7 +85,8 @@ max_workers = 1; } logger.info("Starting with MAX_WORKERS:" + max_workers); - setupThreadPool(max_workers); + + threadPool = Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() ); logger.info("Starting with INCREMENTAL:" + isIncremental); @@ -120,6 +121,7 @@ // END OF MAIN run threadPool.shutdown(); //Calc is done now + threadPool = null;//release early for GC manager.submitTask( new ReloadTask("AfstandAndenRute/" + distributor) ); @@ -235,9 +237,6 @@ return String.format("%02d:%02d:%02d.%03d", hours, minutes, seconds, mseconds); } - private void setupThreadPool(int max_workers) { - threadPool = Executors.newFixedThreadPool(max_workers, new WorkerThreadFactory() ); - } static class WorkerThreadFactory implements ThreadFactory { int count = 0;