RFR: 8225035: Thread stack size issue caused by large TLS size

Andrew Haley aph at redhat.com
Fri Jun 14 08:21:05 UTC 2019


On 6/12/19 8:34 PM, Thomas Stüfe wrote:
> 
> 
> On Wed, Jun 12, 2019 at 6:51 PM Andrew Haley <aph at redhat.com <mailto:aph at redhat.com>> wrote:
> 
>     On 6/12/19 5:05 PM, Thomas Stüfe wrote:
> 
>     > I am currently trying to find out the answer to my original
>     > question: what - in this figure
>     > (https://docs.oracle.com/cd/E19253-01/817-1984/6mhm7plaa/index.html#chapter8-fig-1
>     > - I assume that is the correct one for x64?) - is located on the
>     > thread stack, and where.
> 
>     The stuff on the left-hand side of that diagram is on the thread
>     stack, the rest is dynamically allocated elsewhere.
> 
> 
> Does that mean that TLS from libjvm.so or JNI libraries does not
> live on thread stacks, since those libraries are dynamically loaded
> and therefore would be allocated elsewhere (right side of the
> picture)?

Not necessarily. This is rather target-specific, but there is a small
amount of stack space allocated for __thread variables, and libjvm.so
will use it. The issue we're talking about here only arises when
someone abuses static TLS, and that is very unusual IME. jemalloc is
the only case I've ever heard of.

-- 
Andrew Haley
Java Platform Lead Engineer
Red Hat UK Ltd. <https://www.redhat.com>
https://keybase.io/andrewhaley
EAC8 43EB D3EF DB98 CC77 2FAD A5CD 6035 332F A671


More information about the hotspot-runtime-dev mailing list