# 0.19.11 StackOverflowError

**URL:** https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678
**Category:** Elasticsearch
**Created:** [November 12, 2012, 5:20pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678 "2012-11-12T17:20:03Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)
#### Post date: [November 12, 2012, 5:20pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/1 "2012-11-12T17:20:03Z")

</div>

Hi,

After my move to 0.19.11 - I am getting a StackOverflowError when I try to  
start ES, also I get a SnappyError, which may be related.

The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):

0.19.11 StackOverflowError - Debug Log [https://gist.github.com/4060559](https://gist.github.com/4060559)

- David.

--

---

<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: [November 12, 2012, 6:25pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/2 "2012-11-12T18:25:21Z")

</div>

davrob2 wrote:

> After my move to 0.19.11 - I am getting a StackOverflowError when I try to  
> start ES, also I get a SnappyError, which may be related.
> 
> The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):
> 
> 0.19.11 StackOverflowError - Debug Log [https://gist.github.com/4060559](https://gist.github.com/4060559)

What version of ES were you using before? Seems like what was on  
disk is not compatible with the snappy support in 0.19.11, but that's  
a guess. Any changes besides ES version?

-Drew

--

---

<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: [November 12, 2012, 8:45pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/3 "2012-11-12T20:45:48Z")

</div>

The Snappy message is just a warning and is not related. Your stack trace  
shows you have JVM stack settings that are too small for your JVM to run  
ES. What Java are you running? Are you running ES inside a Solaris zone?

Jörg

On Monday, November 12, 2012 6:20:03 PM UTC+1, davrob2 wrote:

> Hi,
> 
> After my move to 0.19.11 - I am getting a StackOverflowError when I try to  
> start ES, also I get a SnappyError, which may be related.
> 
> The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):
> 
> 0.19.11 StackOverflowError - Debug Log [https://gist.github.com/4060559](https://gist.github.com/4060559)
> 
> - David.

--

---

<div class="post-metadata">

### Author: ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)
#### Post date: [November 13, 2012, 2:57pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/4 "2012-11-13T14:57:10Z")

</div>

Hi,

I changed -d64 JVM flag to -server, on Solaris - just see see what  
happened, and the error changed to this:

[2012-11-13 09:51:09,877][WARN][transport.netty] [Boomerang]  
Message not fully read (request) for [36986] and action , resetting  
[2012-11-13 09:51:09,894][WARN  
][netty.channel.socket.nio.AbstractNioWorker] Unexpected exception in the  
selector loop.  
java.lang.OutOfMemoryError  
at sun.misc.Unsafe.allocateMemory(Native Method)

which is definitely memory related. I'm using the same settings I was  
running on 0.17.6, on the same machine:

JDK: /cs/java/jdk160\_16-64b  
Memory Settings: ES\_MIN\_MEM=3600m, ES\_MAX\_MEM=3600m

- David.

On Monday, 12 November 2012 20:45:49 UTC, Jörg Prante wrote:

> The Snappy message is just a warning and is not related. Your stack trace  
> shows you have JVM stack settings that are too small for your JVM to run  
> ES. What Java are you running? Are you running ES inside a Solaris zone?
> 
> Jörg
> 
> On Monday, November 12, 2012 6:20:03 PM UTC+1, davrob2 wrote:
> 
> > Hi,
> > 
> > After my move to 0.19.11 - I am getting a StackOverflowError when I try  
> > to start ES, also I get a SnappyError, which may be related.
> > 
> > The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):
> > 
> > 0.19.11 StackOverflowError - Debug Log [https://gist.github.com/4060559](https://gist.github.com/4060559)
> > 
> > - David.

--

---

<div class="post-metadata">

### Author: ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)
#### Post date: [November 13, 2012, 3:10pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/5 "2012-11-13T15:10:16Z")

</div>

Just for the record, these are basic Java Settings:

Java home is /cs/java/jdk160\_16-64b

Java bin is /cs/java/jdk160\_16-64b/bin/java

JAVA\_OPTS is -server -Xms3600m -Xmx3600m -Xss128k -Djline.enabled=true  
-XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled  
-XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1  
-XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly

CLASSPATH is  
:/app/securities/rapport/deploy/dev2/ESServer/lib/elasticsearch-0.19.11.jar:/app/securities/rapport/deploy/dev2/ESServer/lib/_:/app/securities/rapport/deploy/dev2/ESServer/lib/sigar/_

On Tuesday, 13 November 2012 14:57:11 UTC, davrob2 wrote:

> Hi,
> 
> I changed -d64 JVM flag to -server, on Solaris - just see see what  
> happened, and the error changed to this:
> 
> [2012-11-13 09:51:09,877][WARN][transport.netty] [Boomerang]  
> Message not fully read (request) for [36986] and action , resetting  
> [2012-11-13 09:51:09,894][WARN  
> ][netty.channel.socket.nio.AbstractNioWorker] Unexpected exception in the  
> selector loop.  
> java.lang.OutOfMemoryError  
> at sun.misc.Unsafe.allocateMemory(Native Method)
> 
> which is definitely memory related. I'm using the same settings I was  
> running on 0.17.6, on the same machine:
> 
> JDK: /cs/java/jdk160\_16-64b  
> Memory Settings: ES\_MIN\_MEM=3600m, ES\_MAX\_MEM=3600m
> 
> - David.
> 
> On Monday, 12 November 2012 20:45:49 UTC, Jörg Prante wrote:
> 
> > The Snappy message is just a warning and is not related. Your stack trace  
> > shows you have JVM stack settings that are too small for your JVM to run  
> > ES. What Java are you running? Are you running ES inside a Solaris zone?
> > 
> > Jörg
> > 
> > On Monday, November 12, 2012 6:20:03 PM UTC+1, davrob2 wrote:
> > 
> > > Hi,
> > > 
> > > After my move to 0.19.11 - I am getting a StackOverflowError when I try  
> > > to start ES, also I get a SnappyError, which may be related.
> > > 
> > > The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):
> > > 
> > > 0.19.11 StackOverflowError - Debug Log [https://gist.github.com/4060559](https://gist.github.com/4060559)
> > > 
> > > - David.

--

---

<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: [November 13, 2012, 7:14pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/6 "2012-11-13T19:14:03Z")

</div>

You should check your custom Xss setting, 128k is too small for 64bit  
stacks on Solaris, 512k is the default.

If this is Java JDK 6u16, this version is very old, released back in  
October, 2009. It is not expected that you can use applications like ES  
flawlessly without unexpected behavior on such old JVMs. And, many bugs and  
security issues have been fixed within the last three years.

Please update to the latest JDK6 (which is 6u37) or JDK7 (the current JDK,  
which is 7u9).

Jörg

On Tuesday, November 13, 2012 4:10:16 PM UTC+1, davrob2 wrote:

> Just for the record, these are basic Java Settings:
> 
> Java home is /cs/java/jdk160\_16-64b
> 
> Java bin is /cs/java/jdk160\_16-64b/bin/java
> 
> JAVA\_OPTS is -server -Xms3600m -Xmx3600m -Xss128k -Djline.enabled=true  
> -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled  
> -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1  
> -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
> 
> CLASSPATH is  
> :/app/securities/rapport/deploy/dev2/ESServer/lib/elasticsearch-0.19.11.jar:/app/securities/rapport/deploy/dev2/ESServer/lib/_:/app/securities/rapport/deploy/dev2/ESServer/lib/sigar/_
> 
> On Tuesday, 13 November 2012 14:57:11 UTC, davrob2 wrote:
> 
> > Hi,
> > 
> > I changed -d64 JVM flag to -server, on Solaris - just see see what  
> > happened, and the error changed to this:
> > 
> > [2012-11-13 09:51:09,877][WARN][transport.netty] [Boomerang]  
> > Message not fully read (request) for [36986] and action , resetting  
> > [2012-11-13 09:51:09,894][WARN  
> > ][netty.channel.socket.nio.AbstractNioWorker] Unexpected exception in the  
> > selector loop.  
> > java.lang.OutOfMemoryError  
> > at sun.misc.Unsafe.allocateMemory(Native Method)
> > 
> > which is definitely memory related. I'm using the same settings I was  
> > running on 0.17.6, on the same machine:
> > 
> > JDK: /cs/java/jdk160\_16-64b  
> > Memory Settings: ES\_MIN\_MEM=3600m, ES\_MAX\_MEM=3600m
> > 
> > - David.
> > 
> > On Monday, 12 November 2012 20:45:49 UTC, Jörg Prante wrote:
> > 
> > > The Snappy message is just a warning and is not related. Your stack  
> > > trace shows you have JVM stack settings that are too small for your JVM to  
> > > run ES. What Java are you running? Are you running ES inside a Solaris zone?
> > > 
> > > Jörg
> > > 
> > > On Monday, November 12, 2012 6:20:03 PM UTC+1, davrob2 wrote:
> > > 
> > > > Hi,
> > > > 
> > > > After my move to 0.19.11 - I am getting a StackOverflowError when I try  
> > > > to start ES, also I get a SnappyError, which may be related.
> > > > 
> > > > The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):
> > > > 
> > > > 0.19.11 StackOverflowError - Debug Log[https://gist.github.com/4060559](https://gist.github.com/4060559)
> > > > 
> > > > - David.

--

---

<div class="post-metadata">

### Author: ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)
#### Post date: [November 13, 2012, 11:04pm UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/7 "2012-11-13T23:04:07Z")

</div>

Thanks for the advice on the xss settings - I'll try an xss of 512k, though  
I did up it to the standard in the 0.20 release without any luck:

# reduce the per-thread stack size

JAVA\_OPTS="$JAVA\_OPTS -Xss256k"

Unfortunately, I'm probably stuck with my Java version, unless I try to get  
an exception from my company, which is probably more trouble than its worth.

Luckily enough - I'll be moving my remaining Solaris environments to Linux  
in the next couple of months, so I may stay with the old version of ES  
until then.

On Tuesday, 13 November 2012 19:14:03 UTC, Jörg Prante wrote:

> You should check your custom Xss setting, 128k is too small for 64bit  
> stacks on Solaris, 512k is the default.
> 
> If this is Java JDK 6u16, this version is very old, released back in  
> October, 2009. It is not expected that you can use applications like ES  
> flawlessly without unexpected behavior on such old JVMs. And, many bugs and  
> security issues have been fixed within the last three years.
> 
> Please update to the latest JDK6 (which is 6u37) or JDK7 (the current JDK,  
> which is 7u9).
> 
> Jörg
> 
> On Tuesday, November 13, 2012 4:10:16 PM UTC+1, davrob2 wrote:
> 
> > Just for the record, these are basic Java Settings:
> > 
> > Java home is /cs/java/jdk160\_16-64b
> > 
> > Java bin is /cs/java/jdk160\_16-64b/bin/java
> > 
> > JAVA\_OPTS is -server -Xms3600m -Xmx3600m -Xss128k -Djline.enabled=true  
> > -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled  
> > -XX:SurvivorRatio=8 -XX:MaxTenuringThreshold=1  
> > -XX:CMSInitiatingOccupancyFraction=75 -XX:+UseCMSInitiatingOccupancyOnly
> > 
> > CLASSPATH is  
> > :/app/securities/rapport/deploy/dev2/ESServer/lib/elasticsearch-0.19.11.jar:/app/securities/rapport/deploy/dev2/ESServer/lib/_:/app/securities/rapport/deploy/dev2/ESServer/lib/sigar/_
> > 
> > On Tuesday, 13 November 2012 14:57:11 UTC, davrob2 wrote:
> > 
> > > Hi,
> > > 
> > > I changed -d64 JVM flag to -server, on Solaris - just see see what  
> > > happened, and the error changed to this:
> > > 
> > > [2012-11-13 09:51:09,877][WARN][transport.netty] [Boomerang]  
> > > Message not fully read (request) for [36986] and action , resetting  
> > > [2012-11-13 09:51:09,894][WARN  
> > > ][netty.channel.socket.nio.AbstractNioWorker] Unexpected exception in the  
> > > selector loop.  
> > > java.lang.OutOfMemoryError  
> > > at sun.misc.Unsafe.allocateMemory(Native Method)
> > > 
> > > which is definitely memory related. I'm using the same settings I was  
> > > running on 0.17.6, on the same machine:
> > > 
> > > JDK: /cs/java/jdk160\_16-64b  
> > > Memory Settings: ES\_MIN\_MEM=3600m, ES\_MAX\_MEM=3600m
> > > 
> > > - David.
> > > 
> > > On Monday, 12 November 2012 20:45:49 UTC, Jörg Prante wrote:
> > > 
> > > > The Snappy message is just a warning and is not related. Your stack  
> > > > trace shows you have JVM stack settings that are too small for your JVM to  
> > > > run ES. What Java are you running? Are you running ES inside a Solaris zone?
> > > > 
> > > > Jörg
> > > > 
> > > > On Monday, November 12, 2012 6:20:03 PM UTC+1, davrob2 wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > After my move to 0.19.11 - I am getting a StackOverflowError when I  
> > > > > try to start ES, also I get a SnappyError, which may be related.
> > > > > 
> > > > > The problem happens on Solaris 10 but not my Suse Linux build (2.6.16):
> > > > > 
> > > > > 0.19.11 StackOverflowError - Debug Log[https://gist.github.com/4060559](https://gist.github.com/4060559)
> > > > > 
> > > > > - David.

--

---

<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: [November 14, 2012, 12:18am UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/8 "2012-11-14T00:18:52Z")

</div>

FYI -Xss values are only estimates, they differ between operating systems  
and machine architectures, so vendors adjust the JVMs for different default  
values in different environments. The ES preconfigured value is not  
guaranteed to be safe. To be honest I don't know why there is  
a preconfigured Xss value at all, maybe there was once assumed that thread  
space consumption could be lowered because ES uses a lot of threads.

Quoting:

"You may be running into a problem with the default stack size for threads.  
In Java SE 6, the default on Sparc is 512k in the 32-bit VM, and 1024k in  
the 64-bit VM. On x86 Solaris/Linux it is 320k in the 32-bit VM and 1024k  
in the 64-bit VM.

On Windows, the default thread stack size is read from the binary  
(java.exe). As of Java SE 6, this value is 320k in the 32-bit VM and 1024k  
in the 64-bit VM.

You can reduce your stack size by running with the -Xss option. For example:

java -server -Xss64k

Note that on some versions of Windows, the OS may round up thread stack  
sizes using very coarse granularity. If the requested size is less than the  
default size by 1K or more, the stack size is rounded up to the default;  
otherwise, the stack size is rounded up to a multiple of 1 MB.

64k is the least amount of stack space allowed per thread."  
[http://www.oracle.com/technetwork/java/hotspotfaq-138619.html](http://www.oracle.com/technetwork/java/hotspotfaq-138619.html)

Jörg

--

---

<div class="post-metadata">

### Author: ![davrob](https://avatars.discourse-cdn.com/v4/letter/d/d78d45/32.png) [@davrob](https://discuss.elastic.co/u/davrob)
#### Post date: [November 19, 2012, 11:51am UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/9 "2012-11-19T11:51:33Z")

</div>

Hi Jorg,

Thanks for your detailed explanation.

-David.

On Wednesday, 14 November 2012 00:18:52 UTC, Jörg Prante wrote:

> FYI -Xss values are only estimates, they differ between operating systems  
> and machine architectures, so vendors adjust the JVMs for different default  
> values in different environments. The ES preconfigured value is not  
> guaranteed to be safe. To be honest I don't know why there is  
> a preconfigured Xss value at all, maybe there was once assumed that thread  
> space consumption could be lowered because ES uses a lot of threads.
> 
> Quoting:
> 
> "You may be running into a problem with the default stack size for  
> threads. In Java SE 6, the default on Sparc is 512k in the 32-bit VM, and  
> 1024k in the 64-bit VM. On x86 Solaris/Linux it is 320k in the 32-bit VM  
> and 1024k in the 64-bit VM.
> 
> On Windows, the default thread stack size is read from the binary  
> (java.exe). As of Java SE 6, this value is 320k in the 32-bit VM and 1024k  
> in the 64-bit VM.
> 
> You can reduce your stack size by running with the -Xss option. For  
> example:
> 
> java -server -Xss64k
> 
> Note that on some versions of Windows, the OS may round up thread stack  
> sizes using very coarse granularity. If the requested size is less than the  
> default size by 1K or more, the stack size is rounded up to the default;  
> otherwise, the stack size is rounded up to a multiple of 1 MB.
> 
> 64k is the least amount of stack space allowed per thread."  
> [Frequently Asked Questions About the Java HotSpot VM](http://www.oracle.com/technetwork/java/hotspotfaq-138619.html)
> 
> Jörg

--

---

<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, 3:03am UTC](https://discuss.elastic.co/t/0-19-11-stackoverflowerror/9678/10 "2017-07-06T03:03:44Z")

</div>


