I have an application that loads data from a .csv file and shows it in a table. The application works correctly for all files (no matter what size it has) in windows, but it only works with the files that are lower than 8MB on Mac, any other file bigger than that throws me a "java.lang.OutOfMemoryError: Java heap space". I debugged the application to make sure that it was reading the .csv file and it does, but after a while it jush crashes with that error.
I did some research and try using the -Xmx and -Xms to increase the Java heap size but still get the same error.
The following code is where the application crashes after adding some of the arrays with information to the mainHashtable:
while(reader.readRecord()){
ArrayList<CSVEntry> list = new ArrayList<CSVEntry>();
for(int i = 0; i < colscount; i++){
CSVEntry entry = new CSVEntry(headerNames[i], reader.get(i));
list.add(entry);
}
mainHashtable.put(recordcount, list);
recordcount++;
}
Any suggestions that help me solve this issue will be gladly appreciated.