Skip to content

Commit 5ec653f

Browse files
authored
Explicitly set Elasticsearch heap size during CI and local development (#86513) (#86573)
1 parent 2ab980a commit 5ec653f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/kbn-es/src/cluster.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ exports.Cluster = class Cluster {
275275

276276
this._log.debug('%s %s', ES_BIN, args.join(' '));
277277

278+
options.esEnvVars = options.esEnvVars || {};
279+
280+
// ES now automatically sets heap size to 50% of the machine's available memory
281+
// so we need to set it to a smaller size for local dev and CI
282+
// especially because we currently run many instances of ES on the same machine during CI
283+
options.esEnvVars.ES_JAVA_OPTS =
284+
(options.esEnvVars.ES_JAVA_OPTS ? `${options.esEnvVars.ES_JAVA_OPTS} ` : '') +
285+
'-Xms1g -Xmx1g';
286+
278287
this._process = execa(ES_BIN, args, {
279288
cwd: installPath,
280289
env: {

0 commit comments

Comments
 (0)