Hello!
I have a little problem with the cost matrix. In my problem, I have a listener for VRP Jobs. It coult be, that a lot of calculations are made.
So for each problem I generate a new Costmatrix, new Services and new Vehicles.
My problem is, that I made some calculation before ( in my biggest example i have a costmatrix with over 300.000 elements) in the next calculation(and when I again start one of my biggest problems), the creation of the costmatrix will hold the programm and it does nothing more.
I don´t know if maybe the garbage collector of Java isn´t working so good. I just tested the creation of multiple matixes.
FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(1000, true);
System.out.println("Matrix 1");
FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder1 = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(1000, true);
System.out.println("Matrix 2");
FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder2 = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(1000, true);
System.out.println("Matrix 3");
FastVehicleRoutingTransportCostsMatrix.Builder matrixBuilder3 = FastVehicleRoutingTransportCostsMatrix.Builder.newInstance(1000, true);
System.out.println("Matrix 4");
in this round, the last print in my case was “Matrix 2”. The processor still is working and the ram usage is stoped at 1,3GB.
Sure in my problems are not used 4 matrixes in a row. But this problem seems to fit to mine with a longer time. I make calculation 1 with a big costmatrix. Then a longer time is nothing to calculate and then comes another calculation with also a big costmatrix. I think the costmatrix of the first run is flying somewhere around the programm and isn´t collected from the carbage collector. It shouldn´t be used because it is a local defined matrix.
Maybe this is not a jsprit problem just a problem with java and my IDE (i use Netbeans). Have you any hints how I can fix that?