java.lang.OutOfMemoryError: Requested array size exceeds VM limit

Dear aspose support team.
We are getting an OutOfMemoryError when trying to use the Image.load function with a psd file >2.4G even though memory is still available
Language : Java
Library Using: com.aspose:aspose-psd:23.4:jdk16
Code Implement :
val imageLoadOp = PsdLoadOptions()|
imageLoadOp.loadEffectsResource = true|
imageLoadOp.useDiskForLoadEffectsResource = true
imageLoadOp.dataRecoveryMode = 2
return Image.load(stream, imageLoadOp) as PsdImage
Error :
Caused by: java.lang.OutOfMemoryError: Requested array size exceeds VM limit
at Source) ~[aspose-psd-23.4-jdk16.jar:23.4]
at com.aspose.psd.internal.gJ.c.a(Unknown Source) ~[aspose-psd-23.4-jdk16.jar:23.4]
at Source) ~[aspose-psd-23.4-jdk16.jar:23.4]
at com.aspose.psd.Image.load(Unknown Source) ~[aspose-psd-23.4-jdk16.jar:23.4]
File Psd Size : 2.5G with Dimension :690 × 10338

I hope your team will check it soon


@Son_Nguyen we will try to create file with the same size and dimensions, I think there are no ways to get it from you.

Could you please additionaly specify version of OS you used. What’s OS. Is it 32 bit or 64? Thank you.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PSDJAVA-497

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hello @Dmitriy.Sorokin I am using macbook pro m1 2021, I think this case is quite easy to create, you can create a psd file with 3G size and this problem will occur