legacy-knowledge-base
公開されました Sep. 10, 2025

'OutOfMemoryError' during PDF preview generation

written-by

Anushka Tiwari

How To articles are not official guidelines or officially supported documentation. They are community-contributed content and may not always reflect the latest updates to Liferay DXP. We welcome your feedback to improve How To articles!

While we make every effort to ensure this Knowledge Base is accurate, it may not always reflect the most recent updates or official guidelines.We appreciate your understanding and encourage you to reach out with any feedback or concerns.

legacy-article

learn-legacy-article-disclaimer-text

Issue

  •  Application nodes frequently crash.
  • The following error appears in the logs:
    ERROR [liferay/document_library_pdf_processor-1][PDFProcessorImpl:795] java.util.concurrent.ExecutionException: com.liferay.petra.process.ProcessException: java.lang.OutOfMemoryError:Java heap space

    java.util.concurrent.ExecutionException: com.liferay.petra.process.ProcessException: java.lang.OutOfMemoryError: Java heap space

Environment

  • Liferay DXP 7.1

Resolution

  • The issue is caused by the system running out of memory while trying to generate preview images from PDF documents, specifically when using PDFBox and occurring the above mentioned error.
  • To resolve this, add the following property to the portal-ext.properties file:
  • # Set the interval in seconds before document previews generation times out
    # and it is cancelled when processed by PDFBox. This property applies only
    # when the property "dl.file.entry.preview.fork.process.enabled" is set to
    # true.

    dl.file.entry.preview.generation.timeout.pdfbox=1200
  • The property specifies the maximum duration the portal will wait for the PDF processor to complete its conversion.
  • By default, this is set to 1200 seconds (20 minutes) in Liferay. You can adjust this value as needed. If the PDFBox process exceeds the configured time limit, process will be terminated, preventing the `OutOfMemoryError`.

Additional Information

  • The ImageMagick or GhostScript connectors can be used as alternatives to PDFBox for generating document previews.
  • Configuring External Services
did-this-article-resolve-your-issue

legacy-knowledge-base