Skip to content

Commit fb0d994

Browse files
authored
Make sure we explicitly specify Xms and Mmx to 1g (#34)
As of: elastic/elasticsearch#65905 The default is dynamic and defaults to 4g on data nodes. I finally had one too many IDE open to this becomming a problem on my 32gig laptop :)
1 parent 4762416 commit fb0d994

File tree

2 files changed

+12
-5
lines changed

2 files changed

+12
-5
lines changed

global.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"sdk": {
3-
"version": "5.0.100"
3+
"version": "5.0.100",
4+
"rollForward": "latestFeature",
5+
"allowPrerelease": false
46
}
57
}

src/Elastic.Elasticsearch.Managed/ElasticsearchNode.cs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,17 @@ private static StartArguments StartArgs(NodeConfiguration config)
4747

4848
private static Dictionary<string, string> EnvVars(NodeConfiguration config)
4949
{
50-
if (string.IsNullOrWhiteSpace(config.FileSystem.ConfigPath)) return null;
51-
return new Dictionary<string, string>
50+
var environmentVariables = new Dictionary<string, string>
5251
{
53-
{ config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath },
54-
{"ES_HOME", config.FileSystem.ElasticsearchHome}
52+
{"ES_JAVA_OPTS", "-Xms1g -Xmx1g"}
5553
};
54+
if (!string.IsNullOrWhiteSpace(config.FileSystem.ConfigPath))
55+
environmentVariables.Add(config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath);
56+
57+
if (!string.IsNullOrWhiteSpace(config.FileSystem.ElasticsearchHome))
58+
environmentVariables.Add("ES_HOME", config.FileSystem.ElasticsearchHome);
59+
60+
return environmentVariables;
5661
}
5762

5863
/// <summary>

0 commit comments

Comments
 (0)