Liferay Enterprise Search
- [LES]: How to install and run the Elastic Support Diagnostics Troubleshooting Utility
 - [LES] About Elasticsearch License expiration
 - [LES] Elasticsearch Virtual Machine Considerations
 - [LES] Getting Started with Liferay Enterprise Search
 - [LES] How to use a load balancer with Elasticsearch?
 - [LES] Installing the Learning-to-Rank plugin on Elasticsearch fails with "IllegalStateException: ltr requires Java 14"
 - [LES] What is the recommended Java heap size for Elasticsearch?
 - [LES] Which node types are charged as part of the Liferay Enterprise Search Subscription
 - Easily customize Liferay's search behavior with Blueprints
 - Elasticsearch 7.17 End of Life (EOL) Timeline and Liferay DXP Elasticsearch Compatibility Update & FAQ
 - Liferay Enterprise Search Experiences (Blueprints) 1.1.0 for DXP 7.3 Release Highlights & Upgrade Instructions
 
[LES] What is the recommended Java heap size for Elasticsearch?
Question
What is the recommended Java heap size for Elasticsearch?
Answer
It depends on what you will be doing. If you use faceting, aggregations, or parent/child queries you will need more heap space. It might make sense to run some performance tests and monitor the heap to figure out what a good heap size would be.
Regardless, we do not recommend setting heap larger than 30.5GB and not more than half available memory, whichever is lower. (e.g. 128GB of available memory = max 30.5GB heap, 64GB of available memory = max 30.5GB heap, 32GB of available memory = max 16GB heap). This upper limit is required to ensure the underlying Lucene software can make use of compressed pointers, which offer a major performance gain.
If you see this in your logs:
[INFO ][o.e.e.NodeEnvironment ] [node01] heap size [30.5gb], compressed ordinary object pointers [true]
then compressed object pointers are being used: good.
But if you see this
[INFO ][o.e.e.NodeEnvironment ] [node01] heap size [35.0gb], compressed ordinary object pointers [false]
then long pointers are being used, and it would be more efficient to reduce the amount of memory given to the elasticsearch heap.
Please, also refer to the following articles for details:
- https://www.elastic.co/guide/en/elasticsearch/reference/current/important-settings.html#heap-size-settings and
 - https://www.elastic.co/guide/en/elasticsearch/guide/current/heap-sizing.html.
 
Elastic, Elasticsearch, and X-Pack are trademarks of Elasticsearch BV, registered in the U.S. and in other countries.