Integrated: JDK-8294266: Add a way to pre-touch java thread stacks

Thomas Stuefe stuefe at openjdk.org
Sun Apr 2 06:24:40 UTC 2023


On Fri, 23 Sep 2022 09:39:41 GMT, Thomas Stuefe <stuefe at openjdk.org> wrote:

> When doing performance- and footprint analysis, `AlwaysPreTouch` option is very handy for reducing noise. It would be good to have a similar option for pre-touching thread stacks. In addition to reducing noise, it can serve as worst-case test for thread costs, as well as a test for NMT regressions.
> 
> Patch adds a new diagnostic switch, `AlwaysPreTouchStacks`, as a companion switch to `AlwaysPreTouch`. Touching is super-simple using `alloca()`. Also, regression test.
> 
> Examples:
> 
> NMT, thread stacks, 10000 Threads, default:
> 
> 
> -                    Thread (reserved=10332400KB, committed=331828KB)                                       
>                             (thread #10021)                                                                 
>                             (stack: reserved=10301560KB, committed=300988KB)                                
>                             (malloc=19101KB #60755)                                                         
>                             (arena=11739KB #20037)                                                          
> 
> 
> NMT, thread stacks, 10000 Threads, +AlwaysPreTouchStacks:
> 
> 
> -                    Thread (reserved=10332400KB, committed=10284360KB)                        
>                             (thread #10021)                                                    
>                             (stack: reserved=10301560KB, committed=10253520KB)                 
>                             (malloc=19101KB #60755)                                            
>                             (arena=11739KB #20037)

This pull request has now been integrated.

Changeset: b8c748db
Author:    Thomas Stuefe <stuefe at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/b8c748dbe468582b9f2a73b17da47148e64cd186
Stats:     153 lines in 4 files changed: 153 ins; 0 del; 0 mod

8294266: Add a way to pre-touch java thread stacks

Reviewed-by: rehn, gziemski

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

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


More information about the hotspot-dev mailing list