RFR: JDK-8294266: Add a way to pre-touch java thread stacks [v4]

Thomas Stuefe stuefe at openjdk.org
Fri Nov 25 15:34:14 UTC 2022


On Fri, 25 Nov 2022 10:30:33 GMT, Robbin Ehn <rehn at openjdk.org> wrote:

> I have seen some workload where just one or two threads are using large stacks and the majority is not. I.e. -Xss256m and similar, 

Yikes...

>having a few hundreds of threads and pre-touching both stacks and heap you may run out of physical pages and start swapping. It would be useful is such case to just pre-touch the first meg or so on the stack.
> 
> I thinking -Xss256m -XX:PreTouchStackSize=1m
> 
> Maybe it is not as useful as in my head... Also I don't know if a user may retrieve good information about stack size usage.
> 
> I'll let you be the arbitrator.
> 

I'll think about it. It may make sense considering your example.

-------------

PR: https://git.openjdk.org/jdk/pull/10403


More information about the hotspot-dev mailing list