Skip to content

Commit

Permalink
Make sure we explicitly specify Xms and Mmx to 1g (#34)
Browse files Browse the repository at this point in the history
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 :)
  • Loading branch information
Mpdreamz authored Feb 16, 2021
1 parent 4762416 commit fb0d994
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
4 changes: 3 additions & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{
"sdk": {
"version": "5.0.100"
"version": "5.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
}
13 changes: 9 additions & 4 deletions src/Elastic.Elasticsearch.Managed/ElasticsearchNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,17 @@ private static StartArguments StartArgs(NodeConfiguration config)

private static Dictionary<string, string> EnvVars(NodeConfiguration config)
{
if (string.IsNullOrWhiteSpace(config.FileSystem.ConfigPath)) return null;
return new Dictionary<string, string>
var environmentVariables = new Dictionary<string, string>
{
{ config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath },
{"ES_HOME", config.FileSystem.ElasticsearchHome}
{"ES_JAVA_OPTS", "-Xms1g -Xmx1g"}
};
if (!string.IsNullOrWhiteSpace(config.FileSystem.ConfigPath))
environmentVariables.Add(config.FileSystem.ConfigEnvironmentVariableName, config.FileSystem.ConfigPath);

if (!string.IsNullOrWhiteSpace(config.FileSystem.ElasticsearchHome))
environmentVariables.Add("ES_HOME", config.FileSystem.ElasticsearchHome);

return environmentVariables;
}

/// <summary>
Expand Down

0 comments on commit fb0d994

Please sign in to comment.