From 933f7bd8aca9969315d7c5444209f675de50f23e Mon Sep 17 00:00:00 2001 From: Brian Seeders Date: Fri, 18 Dec 2020 19:55:56 -0500 Subject: [PATCH] Explicitly set Elasticsearch heap size during CI and local development (#86513) (#86575) --- packages/kbn-es/src/cluster.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/kbn-es/src/cluster.js b/packages/kbn-es/src/cluster.js index 68bcc37c65600..eaf353b3e55d0 100644 --- a/packages/kbn-es/src/cluster.js +++ b/packages/kbn-es/src/cluster.js @@ -275,6 +275,15 @@ exports.Cluster = class Cluster { this._log.debug('%s %s', ES_BIN, args.join(' ')); + options.esEnvVars = options.esEnvVars || {}; + + // ES now automatically sets heap size to 50% of the machine's available memory + // so we need to set it to a smaller size for local dev and CI + // especially because we currently run many instances of ES on the same machine during CI + options.esEnvVars.ES_JAVA_OPTS = + (options.esEnvVars.ES_JAVA_OPTS ? `${options.esEnvVars.ES_JAVA_OPTS} ` : '') + + '-Xms1g -Xmx1g'; + this._process = execa(ES_BIN, args, { cwd: installPath, env: {