RFR(XS) 8191369: NMT: Enhance thread stack tracking

Andrew Dinn adinn at redhat.com
Thu Nov 16 09:48:10 UTC 2017


On 15/11/17 22:25, Zhengyu Gu wrote:
> This is Linux only enhancement for now, can be extended for other
> platforms. (See bug for details)
> 
> Current implementation, thread stack is tracked when thread is created,
> its available stack space is tagged as reserved and committed.
> 
> However, this is not how stack works. Stack pages are committed on
> demand, so this approach overstates its memory usage.
> 
> This enhancement gathers thread stack usage at NMT query time, so that
> it can report more accurate usage.
> 
> Bug: https://bugs.openjdk.java.net/browse/JDK-8191369
> Webrev: http://cr.openjdk.java.net/~zgu/8191369/webrev.00/index.html

The fix looks good to me.

It was very handy that get_stack_commited_bottom was already present in
os_linux.cpp for other reasons -- although as David says it really ought
to be spelled correctly with a double t in committed :-)

It is a good idea to try to extend this to other Unix-variant OSes that
support mincore and to Windows (by whatever other means) but I don't
think that should stop this being added to Linux now. This is too useful
and important to omit because . . .

Footprint is a major concern for cloud deployments (where memory use is
part of costing) and Linux underpins a significant proportion of cloud
deployments. More accurate measurement of JVM footprint on Linux is
going to be a great help to Java users when it comes to identifying and
reducing the cost of cloud deployments.

regards,


Andrew Dinn
-----------
Senior Principal Software Engineer
Red Hat UK Ltd
Registered in England and Wales under Company Registration No. 03798903
Directors: Michael Cunningham, Michael ("Mike") O'Neill, Eric Shander


More information about the hotspot-runtime-dev mailing list