Free Support Forum - aspose.com

copyRange throws java.lang.OutOfMemoryError: Java heap space

Hi,

I have attached the tempalte file. The error has occured in the following code:

@Test

public void copyRangeTest() throws Exception {

Workbook book = new Workbook("c:\\temp\\test.xlsx");

Worksheet sheet = book.getWorksheets().get(0);

Cells cells = sheet.getCells();


Range range = cells.createRange(14, 0, 86, 39);

Range source = cells.createRange(13, 0, 1, 39);


PasteOptions options = new PasteOptions();

options.setPasteType(PasteType.ALL);


range.copy(source, options);

}


Output looks as follows:

java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2219)
at java.util.ArrayList.grow(ArrayList.java:242)
at java.util.ArrayList.ensureExplicitCapacity(ArrayList.java:216)
at java.util.ArrayList.ensureCapacityInternal(ArrayList.java:208)
at java.util.ArrayList.add(ArrayList.java:440)
at com.aspose.cells.b.a.a.ze.a(Unknown Source)
at com.aspose.cells.HyperlinkCollection.a(Unknown Source)
at com.aspose.cells.HyperlinkCollection.a(Unknown Source)
at com.aspose.cells.Range.a(Unknown Source)
at com.aspose.cells.Range.copy(Unknown Source)
...

Could you scrutinize the issue and fix the problem ASAP?

Thanks.

Hi,

Thanks for your posting and using Aspose.Cells.

Please download and use the latest version: Aspose.Cells for Java (Latest Version) it works fine with your sample code and source excel file and does not throw any exception.

Hi,

We use Aspose.Cells for Java v8.4.2.2. And so in the stable branch of product it is imposiible to use v8.4.2.8 as it has significant changes http://www.aspose.com/community/forums/thread/635765/aspose-custom-calculation-issue.aspx since version 8.4.2.5 and above. These changes cannot be used as part of stable pack as requires a lot of fixes based on Aspose API modifications.

Could you provide version before 8.4.2.5 (8.4.2.3 or 8.4.2.4) that has copyRange bug fixed to eliminate destabilization of stable branch of our product?

Thanks.

Hi,

Thanks for your posting and using Aspose.Cells.<br>
8.4.2.2 is just a very close version to 8.4.2.5 or 8.4.2.8. There are not any intermediate versions that we could test with and provide it to you. So you will have to use the latest version. Also, you can wait for the next java official version 8.5.0 which will be released in this week or next week.

Please remember we always fix the issues if they occur in the latest versions only. If some issue is occurring in the older version and not occurring with the latest version, we do not fix that issue because it is already fixed in the latest version.