DEV Community

Saravanan Muniraj
Saravanan Muniraj

Posted on

com.liferay.petra.process.ProcessException: java.lang.OutOfMemoryError: Unable to process file version

Issue
Liferay Site goes down due to outofMemoryError. When someone upload the inappropriate PDF file in Liferay Media and Document
The flowing error message thrown:

[liferay/document_library_pdf_processor-1][BaseProcessorMessageListener:40] Unable to process file version 123456
java.util.concurrent.ExecutionException: com.liferay.petra.process.ProcessException: java.lang.OutOfMemoryError
at java.util.concurrent.FutureTask.report(FutureTask.java:122)
at java.util.concurrent.FutureTask.get(FutureTask.java:206)
[ommited]
Caused by: com.liferay.petra.process.ProcessException: java.lang.OutOfMemoryError: Java heap space
at com.liferay.petra.process.local.LocalProcessLauncher.main(LocalProcessLauncher.java:153)
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferInt.(DataBufferInt.java:75)
at java.awt.image.Raster.createPackedRaster(Raster.java:467)
at java.awt.image.DirectColorModel.createCompatibleWritableRaster(DirectColorModel.java:1032)
at java.awt.image.BufferedImage.(BufferedImage.java:324)

How Can I fix this error?
Environment
Liferay DXP 7.1

Resolution
Run the below SQL script and get the file details:
SELECT USERNAME,CREATEDATE,MODIFIEDDATE,FILENAME,TITLE,SIZE_ FROM DLFILEENTRY (NOLOCK) WHERE FILEENTRYID IN
(SELECT FILEENTRYID FROM DLFILEENTRYMETADATA (NOLOCK) WHERE FILEVERSIONID IN (123456))

  1. Remove the file from Liferay document and media.
  2. Ensure that all content/pages of the PDF file are in the same layout orientation throughout the file. All pages must either be in portrait or landscape orientation — the file cannot contain a mixture of portrait and landscape sizes.
  3. Once you have verified that the pages are in the same orientation, save the PDF files using the Save as Optimized option via Adobe Acrobat Pro. This will compress the file size and remove unnecessary code for faster viewing.

Top comments (0)