Hi I have my program structure - in a spring boot project as below:
in a Service class: File 1 - loaded in arraylist1(list of pojos)
File 2 -- loaded in arraylist2(list of pojos)
File 3- loaded in arraylist3(list of pojos)
input file --- parsed and loaded in arraylist. output Arraylist for (iterate input file- arraylist){
//for output field 1
for(iterate in file1){
if field available in file1 - assign output column
else
reject record..
}
//for output field 2
for(iterate in file2){
if field available in file2 - assign output column
else
reject record..
}
//for output field 3
for(iterate in file3){
if field available in file3 - assign output column
else
reject record..
}
assign to other output fields from input fields..
output field 4=inputfield 4
output field 5=inputfield 5
output field 6=inputfield 6
output field 7=inputfield 7
output field 8=inputfield 8
outputList.add(output pojo) }
So while reading the File 2 which is of 2 gb , the process hungs or throws Out of memory error. Completely stuck with this,Please help with this problem. Thank you