Tu scheduli una nuova istanza della classe BatchsyncroAlert ogni 5 secondi.
Ecco perchè saturi lo heap.
Prova a gestire un singleton di questa classe.
codice:......... timer.scheduleAtFixedRate(BatchSyncroAlert.getSingleton(), new Date(), millis); ......... public class BatchSyncroAlert { // un oggetto di tipo BatchSyncroAlert private static BatchSyncroAlert singleton; private BatchSyncroAlert() { } public static BatchSyncroAlert getSingleton() { if (singleton == null) { singleton = new BatchSyncroAlert(); } return singleton; } public void run() { .......... } }

Rispondi quotando