Question on the Default Kibana NodeJS Setting --max-old-space-size=2048

The below note for ECK seems to imply that setting the container mem limits should suffice instead of overriding the pod spec template for kibana.

https://www.elastic.co/docs/deploy-manage/production-guidance/kibana-configure-memory#:~:text=specific%20performanc[…]ge,Manage%20background%20tasks

With so many plugins and saved object migrations, I would imagine the default of 2048 might be low...

Does uing ECK , auto set the nodejs heap and use the available container memory (Eg:- container limit set to 16GB) even when the ECK is set to --max-old-space-size=2048 ?

They're independent. The ECK operator doesn't automatically adjust the heap based on the container limit. Elasticsearch does this automatically from 7.11+ (ECK compute resources docs), but Kibana has no such mechanism. So even if you set the container limit to 16GB, if --max-old-space-size=2048 stays as-is, the heap is capped at 2GB. For Kibana, you need to explicitly set NODE_OPTIONS as an env var in the podTemplate, and adjust it together with the container limit (ECK Kibana advanced configuration docs).

Thanks @covj12

Just that it seems peculiar that the below statement in the official docs explicitly mentions not to override it

In orchestrated environments like Elastic Cloud Hosted, Elastic Cloud Enterprise, or Elastic Cloud on Kubernetes, you should not override Kibana’s default memory limit using --max-old-space-size. Instead, set the desired Kibana memory size at the deployment level. This automatically adjusts the container’s memory allocation and ensures more consistent and predictable performance.