Hi,
The XLSX file is too large to attach here, so here’s a link to the file, shared in my Google Drive:
https://drive.google.com/file/d/1Nx04rnfCXQY8EGj9lkhGCMxyYlziP-Ip/view?usp=sharing
Here’s the test program I’m using. It’s written in Kotlin (1.3). I’m running it inside IntelliJ, in case that matters.
import com.aspose.cells.*
class LCDH: LightCellsDataHandler {
override fun processCell(cell: Cell?): Boolean {
return false
}
override fun processRow(row: Row?): Boolean {
return true
}
override fun startSheet(worksheet: Worksheet?): Boolean {
return worksheet?.index==0
}
override fun startCell(column: Int): Boolean {
return true
}
override fun startRow(rowNumber: Int):Boolean {
if(rowNumber%10000==0)
println("Row $rowNumber reached.")
return true
}
}
fun main()
{
val loadOptions=LoadOptions()
loadOptions.lightCellsDataHandler=LCDH()
Workbook("aspose_meellionRows.xlsx",loadOptions)
}
The process very quickly grabs almost 2 gigabytes of memory, then increases slowly to 2.1GB.
It works for a while, but then gets slower and slower, until …
...
Row 810000 reached.
Row 820000 reached.
Row 830000 reached.
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at java.base/java.util.HashMap.resize(HashMap.java:704)
at java.base/java.util.HashMap.putVal(HashMap.java:663)
at java.base/java.util.HashMap.put(HashMap.java:612)
at com.aspose.cells.zbuy.a(Unknown Source)
at com.aspose.cells.zbuy.a(Unknown Source)
at com.aspose.cells.zano.a(Unknown Source)
at com.aspose.cells.zano.B(Unknown Source)
at com.aspose.cells.zano.A(Unknown Source)
at com.aspose.cells.zano.z(Unknown Source)
at com.aspose.cells.zano.a(Unknown Source)
at com.aspose.cells.zclz.a(Unknown Source)
at com.aspose.cells.zd.d(Unknown Source)
at com.aspose.cells.zd.p(Unknown Source)
at com.aspose.cells.zd.a(Unknown Source)
at com.aspose.cells.zanm.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.a(Unknown Source)
at com.aspose.cells.Workbook.<init>(Unknown Source)
at AsposeTestKt.main(AsposeTest.kt:31)
at AsposeTestKt.main(AsposeTest.kt)
Process finished with exit code 1
If I replace the “return false” in processCell() with “return true”, the process dies around the 400,000 row mark.
I’ve run a similar test using the Apache POI libraries (XSSFSheetXMLHandler). The java.exe process never exceeds 200MB, although it is a bit slower than Aspose.