I have an infinite loop that performs a series of operations with different types of files, reads files, creates different xml and inserts it into a database. For this I use the following code:
public static void main(String[] args) throws IOException {
Thread_WKAS miRunnable = new Thread_WKAS();
Thread hilo1= new Thread(miRunnable);
hilo1.start();
}
private static class Thread_WKAS implements Runnable{
public void run() {
while (true){
leer_archivos_crear_archivos_insertar_registros();
System.gc();
System.runFinalization();
System.gc();
}
}
}
The problem I have is that when it has been working for several days the RAM memory is filled to the 1024 MB that I have indicated with VM Options -Xms 1024m. What indicates to me that the garbage collector does not eliminate the references of the variables, I have read that putting the variables used to null the garballe collector would eliminate the dead references, but I have a lot of internal variables. My question is if there is a different option so that it does not increase the size of the memory used in the application?