Elasticsearch not starting {0.90.0} : Startup Failed

I am not able to start elasticsearch. I tried

bin/elasticsearch

bin/elasticsearch -f

bin/elasticsearch -f ES_HEAP_SIZE=4g

but I keep getting the following message after a two-second pause...

{0.90.0}: Startup Failed ...

  • OutOfMemoryError[unable to create new native thread]

NOTE 1: elasticsearch was working perfectly for me before I indexed 4 million documents into the server, after which I kept getting this error.

NOTE 2: even though elasticsearch does not startup, I am still able to execute the curl command on the elasticsearch server (strange indeed because elasticsearch is not running on the host machine - using ps command)

curl -XGET http://localhost:9200
{
"ok" : true,
"status" : 200,
"name" : "Thumbelina",
"version" : {
"number" : "0.90.0",
"snapshot_build" : false
},
"tagline" : "You Know, for Search"
}

My guess is that one of the search queries to the 4 million documents is still running but I tried exiting the terminal, killing the process, increasing the heap size and stopping the elasticsearch process using bin/elasticsearch stop. My elasticsearch version is 0.90.0. Sorry for the long question and any help would be great. Thanks.