Parsing Large File

Hi Team,
we are using Aspose cells commercial version for the past 3 years. now we are supporting large file upload CSV and spreadsheet files, for that, we are decided to go with aspose cells.
But for parsing large files it throws out of heap. Even I tried with lightcellsAPI.

   AsposeListener listener = new AsposeListener();
		LoadOptions options= new LoadOptions();	    
	    options.setLightCellsDataHandler(listener);
	    try {
	    	
	    	System.out.println("Parsing starts...");
	    	Workbook b = new Workbook(this.getInputStream(),options);	// Handle Workbook that having multiple sheets.
	    	WorksheetCollection sheets = b.getWorksheets();
	    	System.out.println("Parsing Ends...");
	    }
        catch(Exception e) {
        	System.out.println(" Exception caught in Aspose Parser "+e.getMessage());
        }

LightCells Handler

public class AsposeListener implements LightCellsDataHandler{
	
	@Override
	public boolean processCell(Cell arg0) {
		System.out.println(arg0.getValue());
		return false;
	}
	
	

	@Override 
	public boolean processRow(Row row) {
		return true;
	}
	
	

	@Override
	public boolean startCell(int arg0) {
		return true;
	}

	
	
	@Override
	public boolean startRow(int arg0) {
		return true;
	}	


	@Override
	public boolean startSheet(Worksheet arg0) {
		return true;
	}

}

so , how to parse large files (around 400MB xlsx files)?

@Sundarcj,

Thanks for the sample code segment and details.

Generally, such an exception occurred when there are lots of strings or formulas in the worksheet cells. So, first you need to check whether there are large amount of string values/formulas in the template file, I am afraid, the memory cost cannot be improved much in this case. The reason is due to the fact that string values are in global cache in memory and in the template file, so they should be loaded completely before loading/parsing cell objects even in light weight mode. By the way, you can also check whether there are lots of other objects in the spreadsheet, such as, pictures, vba code/macros, Ole objects, etc. If this is the case, the memory cost also will be high. For this situation, you can use LoadFilterOptions to skip those objects. For example, you can use LoadFilterOptions.CellData option only. With this option and LightCellsDataHandler, memory issues caused by these objects should be fixed.

Please do the needful as discussed above to sort it out. In case, you are still not able to figure it out, kindly share the template file (you may zip the file and upload to some file sharing service (e.g dropbox, Google drive, etc.) and provide the link to download the file), we will check it soon.