Out of memory error in elasticsearch

You have far, far too many shards given the number of nodes and heap size of your cluster. Have a look at this blog post for some practical guidance and then change your sharding strategy to reduce the shard count in the cluster significantly.