Legacy Knowledge Base
Published Jun. 30, 2025

Why does my Liferay Docker container slowly accumulate memory over time and run into OutOfMemoryErrors?

Written By

John Park

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

You are viewing an article from our legacy "FastTrack" publication program, made available for informational purposes. Articles in this program were published without a requirement for independent editing or verification and are provided"as is" without guarantee.

Before using any information from this article, independently verify its suitability for your situation and project.

Issue

  • In some implementations of containerized Liferay Docker environments, there are reports of memory usage slowly increasing over time until an OutOfMemoryError is reached or the pod alerts trigger a kill of the pod. 
  • After observing that native OS memory allocated to JVM threads are not getting released completely, the current explanation for this is that the OS’s `malloc` implementation from the glibc library is responsible for this.
  • As Liferay spawns a large amount of threads, this issue may make itself more apparent, especially for installations that serve a large number of users.

Environment

  • Liferay PaaS
  • Quarterly Release

Resolution

  • TCMalloc was added to mitigate this issue. 
  • The environment variable to enable TCMalloc should be configured in the Liferay service Cloud Console or LCP.json file by setting the DOCKER_TCMALLOC_ENABLED variable to true 

Additional Information

 

Did this article resolve your issue ?

Legacy Knowledge Base