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 is) in windows, but only works with files below 8 MB on a Mac, any other file is bigger than it does to me "java.lang.OutOfMemoryError: Java empty space " I debugged the application to make sure it reads the .csv file and it does, but after a while it will fail with this error.
I did some research and tried using -Xmx and -Xms to increase the Java heap size, but still getting the same error.
The following code is where the application crashes after adding some arrays of information to 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 will help me solve this problem will be appreciated.
source share