Issues with chart having large data range

Hi,

We have issues below when converting a spreadsheet with a chart having a large data range,

  • InterruptMonitor is not working
  • Out of Memory Error due to large data range

As of the chart data range, is there an API we can use to know the count of cells before running the conversion?

Please useaspose-excel.zip (1014.0 KB)
the attached sample to see the details.

Regards,

Feng

@atlassian

Thanks for your posting and considering Aspose.Cells.

We were able to observe this issue and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will update you asap.

This issue has been logged as

  • CELLSJAVA-42420 - Cancellation and Out of Memory Issue because of Large Data Range of Chart

Console Output of Project

===============    Step:  1: before new WorkBook   ============
totalHeap: 123; maxHeap: 1799; freeHeapMb: 120; usedHeap: 3
===============================================
===============    Step:  2: after new WorkBook   ============
totalHeap: 575; maxHeap: 1799; freeHeapMb: 491; usedHeap: 84
===============================================
used memory for workbook is 81
converting...
Cancelling conversion!!
Exception in thread "main" java.lang.OutOfMemoryError: GC overhead limit exceeded
	at com.aspose.cells.b.a.b.zo.a(Unknown Source)
	at com.aspose.cells.zqj.<init>(Unknown Source)
	at com.aspose.cells.zjt.<init>(Unknown Source)
	at com.aspose.cells.zjt.<init>(Unknown Source)
	at com.aspose.cells.zjv.a(Unknown Source)
	at com.aspose.cells.zke.a(Unknown Source)
	at com.aspose.cells.zke.d(Unknown Source)
	at com.aspose.cells.zke.a(Unknown Source)
	at com.aspose.cells.zke.b(Unknown Source)
	at com.aspose.cells.Chart.F(Unknown Source)
	at com.aspose.cells.zat.c(Unknown Source)
	at com.aspose.cells.zat.a(Unknown Source)
	at com.aspose.cells.zat.a(Unknown Source)
	at com.aspose.cells.zat.a(Unknown Source)
	at com.aspose.cells.zat.a(Unknown Source)
	at com.aspose.cells.zat.b(Unknown Source)
	at com.aspose.cells.zat.c(Unknown Source)
	at com.aspose.cells.zat.a(Unknown Source)
	at com.aspose.cells.a.d.zfj.a(Unknown Source)
	at com.aspose.cells.zbyu.a(Unknown Source)
	at com.aspose.cells.zbyu.a(Unknown Source)
	at com.aspose.cells.zbyu.a(Unknown Source)
	at com.aspose.cells.Workbook.a(Unknown Source)
	at com.aspose.cells.Workbook.save(Unknown Source)
	at com.aspose.cells.Workbook.save(Unknown Source)
	at com.atlassian.confluence.server.test.aspose.CellConverter.convert2PDF(CellConverter.java:78)
	at com.atlassian.confluence.server.test.aspose.CellConverter.main(CellConverter.java:51)

@atlassian

Please download and try the latest fix and let us know your feedback.

Many thanks for the quick response, @shakeel.faiz,

I have tested with 17.9.2, which has resolved the issue for that special spreadsheet, and I’ve also noticed that it now consumes less memory compared to previous versions. Do you have the answer for my last question with regards to the API to return the data range used by a chart?

Regards,

Feng

@atlassian

Here are the list of functions that could suit your needs.

  • Worksheet.getCells().getMaxRow();
  • Worksheet.getCells().getMaxDataRow();
  • Worksheet.getCells().getMaxColumn();
  • Worksheet.getCells().getMaxDataColumn();

  • Worksheet.getCells().getMaxDisplayRange();
  • Worksheet.getCells().getLastCell();

  • Chart.getNSeries().getCategoryData();

The issues you have found earlier (filed as CELLSJAVA-42420) have been fixed in Aspose.Cells for Java 17.10.