Setting Elasticsearch Heap Size in Windows

Elasticsearch has an option to configure the memory which is used by elasticsearch java process.

The memory can be configured using various Environmental Variables.

The default Heap Size of an elasticsearch process in 1gb. The ES_HEAP_SIZE environment variable allows setting the heap memory that will be allocated to elasticsearch java process.

We can set Environment Variable as follows

ES_HEAP_SIZE
4g

 

We can check allocated memory using service manager of elasticsearch as follows

cmd

 

manager

 

And another option is to lock the process address space into RAM, preventing any Elasticsearch memory from being swapped out by configuring as follows in Elasticsearch configuration file (config/elasticsearch.yml)

bootstrap.mlockall: true

 

We can check whether settings are applied to the nodes or not by using any one of the following commands

curl http://localhost:9200/_nodes/process?pretty
GET /_nodes/process?pretty
If we receive mlockall is false by running above commands, then it means that the mlockall request has failed.
Explore data using Elastic 🙂
Note:
Note that the environment configuration options available during the installation are copied and will be used during the service life cycle. This means any changes made to them after the installation will not be picked up unless the service is reinstalled.

Elasticsearch is having some minor issue in locking the memory(using Virtual lock) in Windows OS; there is already an open issue raised in Github repository of elastic.

 

Creating alias for GIT commands

Lets see a small tip that can make our Git experience more easier in dealing with Git commands by creating aliases.

By using aliases feature we can able to map the Git commands with our own set of languages (probably some decent words). 🙂

Here are few samples,

we can able to create alias by executing following commands in Git bash

$ git config –global alias.drag pull
$ git config –global alias.drop push
$ git config –global alias.st status

After setting alias, we can use the alias name instead of the Git command keyword.

For example,

If we wish to view the staus of repository, we can simply execute the following command

$ git st

Few more,

pandiyan@TARZAN MINGW64 /d/usr/Pandiyan/Repos/ElasticBridge (master)
$ git config –global alias.drag pull

pandiyan@TARZAN MINGW64 /d/usr/Pandiyan/Repos/ElasticBridge (master)
$ git drag
Already up-to-date.

pandiyan@TARZAN MINGW64 /d/usr/Pandiyan/Repos/ElasticBridge (master)
$

We can also edit them or add more by modifying the .gitconfig file directly:

[alias]
drag = pull
st = status

 

gitconfig

Just try out.
Happy coding !