I am getting java.lang.OutOfMemoryError: Java heap space while reading Excel file into java bean using XLSReader
Here is the code snippet.
public static <T> List<T> parseExcelFileToBeans(final File xlsFile,
final File jxlsConfigFile)
throws Exception {
final XLSReader xlsReader = ReaderBuilder.buildFromXML(jxlsConfigFile);
final List<T> result = new ArrayList<>();
final Map<String, Object> beans = new HashMap<>();
beans.put("result", result);
try (InputStream inputStream = new BufferedInputStream(new FileInputStream(xlsFile))) {
xlsReader.read(inputStream, beans);
}
return result;
}