RFR(L): JDK-8046936 : JEP 270: Reserved Stack Areas for Critical Sections

David Holmes david.holmes at oracle.com
Thu Dec 3 05:53:12 UTC 2015


On 3/12/2015 12:56 AM, Doug Lea wrote:
>
> Bringing Martin's JEP comment
> (https://bugs.openjdk.java.net/browse/JDK-8046936)
> to the lists:
>
> Approximately 100% of the cases of StackOverflowError (SOE) we
> hear about lately on concurrency-interest are due to long chains
> of CompletableFutures that exist because of the lack of
> tail-recursion loopification by compilers. I don't think
> any of these have involved ReentrantLocks, but some hit problems
> due to lack of finally { ... } cleanup inside Executors upon SOE.
>
> In the absence of any of: tail-recursion support, reliable cleanup,
> or growable stacks, it seems reasonable to choose larger default
> stack sizes so that these long but finite chains of completions
> are far less likely to hit SOE.
>
> On 32bit systems the 1MB limit is completely defensible. But expanding
> to say 64MB on 64bit systems would reduce practical encounters with
> SOE in these kinds of constructions by a factor of 64 or so.
> Is there any reason not to do this?

The same discussion on the concurrency-interest mailing list seems to 
indicate that there are indeed reasons to not do this.

http://cs.oswego.edu/pipermail/concurrency-interest/2015-December/014596.html

David

> -Doug
>
>
>



More information about the core-libs-dev mailing list