RFR: 8328473: StringTable and SymbolTable statistics delay time to safepoint [v2]

Coleen Phillimore coleenp at openjdk.org
Tue Feb 25 12:51:54 UTC 2025


On Mon, 24 Feb 2025 18:41:28 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> This change adds a safepoint poll to gathering statistics for the Symbol and String tables, using the ConcurrentHashTableTasks to chunk up the walk.  The stringTable and symbolTable is similar, like the GrowTask and DeleteTask code.  Maybe this can be cleaned up but I don't have a good idea about that yet that doesn't involve yet another level of templated functions and code. This is already pretty highly templatized.
>> Tested with tier1-4 and runThese internal test with JFR and failure injection to verify that we do try to safepoint while gathering statistics.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Fxi typo.

We have this internal tests that run all the JCKs for 30 minutes with JFR and JVMTI on (runThese) so it safepoints a lot and JFR gathers these statistics every 10 seconds.  Running with -Xlog:safepoint and gathering out the "Reaching safepoint: " value from the log lines, eg:


[91.266s][info][safepoint       ] Safepoint "ThreadDump", Time since last: 6550046 ns, Reaching safepoint: 199739 ns, At safepoint: 342759 ns, Total: 542498 ns


And ran this python script:


import re
total = count  = 0
lines = open('out', 'r').read().splitlines()
for line in lines:
  try:
    digit = lambda x: int(x)
    res = digit(line)
    total += res
    count += 1
  except ValueError:
    pass
if count > 0:
  print ("Total evaluated numbers: " + str(count))
  print ("Total: " + str(total))
  print ("Average: " + str(total/count))


Before my change the results are:


Total evaluated numbers: 7980
Total: 51916917448
Average: 6505879.3794486215


After this change:


Total evaluated numbers: 8052
Total: 36508335385
Average: 4534070.465101838


I probably could write a more directed test to see if it's really the symbol/string table change, but I thought this was interesting.

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

PR Comment: https://git.openjdk.org/jdk/pull/23750#issuecomment-2681875152


More information about the hotspot-dev mailing list