RFR: 8299426: Heap dump does not contain virtual Thread stack references [v2]

Alex Menkov amenkov at openjdk.org
Thu Nov 30 00:36:11 UTC 2023


On Wed, 29 Nov 2023 22:16:53 GMT, Serguei Spitsyn <sspitsyn at openjdk.org> wrote:

>> I think the easiest solution is probably just coming up with some reasonable max sequence number and then just assuming that you will need enough chars for it. But if you want to actually compute it, there are a few solutions, including a simple div by 10 loop.
>
> Nice catch! This spot attracted my eyes as well on the first reading.
> `sprintf` can be simple to use:
> 
>  char result[100]; 
>  int number_of_digits = sprintf(result, "%d", seq);

I decided to always reserve 10 symbols (theoretical max number of GC threads is 2^15)

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

PR Review Comment: https://git.openjdk.org/jdk/pull/16665#discussion_r1410021999


More information about the serviceability-dev mailing list