# Best java to run ElasticSearch

**URL:** <https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840>\
**Category:** Elasticsearch\
**Created:** [February 21, 2013, 2:32pm UTC](https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840 "2013-02-21T14:32:39Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kazimieras\_Aliulis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kazimieras_aliulis/32/2480_2.png) [@Kazimieras\_Aliulis](https://discuss.elastic.co/u/Kazimieras_Aliulis)\
**Post date:** [February 21, 2013, 2:32pm UTC](https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840/1 "2013-02-21T14:32:39Z")

</div>

Hi,

I wanted to ask which java version is best to run ElasticSearch on. I am  
running ES on JRockit 1.6. Maybe it would be more stable on OpenJDK or  
HotSpot or 1.7?

--  
Sincerely  
Kazimieras Aliulis

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)\
**Post date:** [February 21, 2013, 3:35pm UTC](https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840/2 "2013-02-21T15:35:37Z")

</div>

There are some factors for ES that are important when it comes to  
selecting a JVM.

Technically, to take most advantage of ES, a JVM must be able to  
allocate large virtual address space (so 64bit is good), it should  
perform garbage collection on large heaps quickly without pausing the  
JVM (Java 7 has made progress on it, but G1 GC is not mature enough  
yet), and it must be able to run a lot of threads in parallel (which  
means, the JVM should perform well in exploiting all the threading  
capabilities of the underlying operating system).

Lucene (and of cource Elasticsearch) is on of the most challenging piece  
of Java software for a JVM because it can create a lot of stress  
situations where a JVM must prove that is was really implemented to cope  
with heavy workloads.

In my eyes, stability is a feature for having faulty hard- and software  
behavior fixed soon. In the beginning of opening the Java JDK source  
code by SUN, in the early OpenJDK releases, a lot of unfixed bugs were  
ported to the open source versions while the closed source JDK had them  
fixed. And, the first OpenJDK 6 releases were in fact containing JDK 7  
alpha quality code that was just backported to the JDK 6 API, with  
numerous known bugs. So I recommend not to deploy ES on early OpenJDK 6  
versions.

Today, it's not easy for me to tell if Oracle will always provide  
"stable enough" JVM software, because only OpenJDK is open sourced,  
while other Oracle JVM source code like security fixes and JRockIt is  
hidden. The Oracle support for OpenJDK is somewhat restricted but the  
OpenJDK community contains big players (like Apache and IBM) and they  
are all committed to maintain a certified, solid, and reliable codebase  
which is important for stability. Note that Google forked the JVM code  
to build Dalvik for Android. There are also other JVM vendors, most  
prominent one is IBM. But I don't have any measurable facts about JVM  
stability of different vendors. In the end, it's up to you to test  
several JVMs and find out the most appropriate one for your purpose.

Jörg

Am 21.02.13 15:32, schrieb Kazimieras Aliulis:

> I wanted to ask which java version is best to run Elasticsearch on. I  
> am running ES on JRockit 1.6. Maybe it would be more stable on OpenJDK  
> or HotSpot or 1.7?

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [February 21, 2013, 3:39pm UTC](https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840/3 "2013-02-21T15:39:57Z")

</div>

I never had much luck with OpenJDK. It is alway a considerable improvement  
when I switch over to Oracle's JVM.

--  
Ivan

On Thu, Feb 21, 2013 at 6:32 AM, Kazimieras Aliulis \<  
[kazimieras.aliulis@gmail.com](mailto:kazimieras.aliulis@gmail.com)\> wrote:

> Hi,
> 
> I wanted to ask which java version is best to run Elasticsearch on. I am  
> running ES on JRockit 1.6. Maybe it would be more stable on OpenJDK or  
> HotSpot or 1.7?
> 
> --  
> Sincerely  
> Kazimieras Aliulis
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![drewr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/drewr/32/7803_2.png) [@drewr](https://discuss.elastic.co/u/drewr)\
**Post date:** [February 21, 2013, 4:11pm UTC](https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840/4 "2013-02-21T16:11:35Z")

</div>

Kazimieras Aliulis wrote:

> I wanted to ask which java version is best to run Elasticsearch  
> on. I am running ES on JRockit 1.6. Maybe it would be more stable  
> on OpenJDK or HotSpot or 1.7?

We actively test OpenJDK and Oracle Java, but JRockit has been known  
to work fine.

We prefer that you use 7, but 6 is ok if you are stuck on it.

Most importantly, run the latest update of the version you choose.  
For Oracle, at least 1.6u38 or 1.7u10. For OpenJDK, 6b24 or 7u3.  
There have been numerous bugfixes over the last couple years that are  
important to ES stability at scale.

-Drew

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 2:50am UTC](https://discuss.elastic.co/t/best-java-to-run-elasticsearch/10840/5 "2017-07-06T02:50:17Z")

</div>


