RFR: 8229517: Support for optional asynchronous/buffered logging [v2]

Xin Liu xliu at openjdk.java.net
Sun Mar 28 01:46:47 UTC 2021


On Fri, 26 Mar 2021 19:05:28 GMT, Xin Liu <xliu at openjdk.org> wrote:

>> Agreed. No need for an extra option. Handle it like other logging framework defaults (e.g. `DefaultFileCount` or `DefaultFileSize`)
>> 
>> You also have to check that `LogAsyncInterval` is zero modulo 10 otherwise you'll get:
>> $ ./images/jdk/bin/java -XX:LogAsyncInterval=13 -Xlog:gc:file=/tmp/class.log::async=true -version
>> # To suppress the following error report, specify this argument
>> # after -XX: or in .hotspotrc:  SuppressErrorAt=/task.cpp:73
>> #
>> # A fatal error has been detected by the Java Runtime Environment:
>> #
>> #  Internal Error (/priv/simonisv/OpenJDK/Git/jdk/src/hotspot/share/runtime/task.cpp:73), pid=21168, tid=21169
>> #  assert(_interval >= PeriodicTask::min_interval && _interval % PeriodicTask::interval_gran == 0) failed: improper PeriodicTask interval time
>> #
>> # JRE version:  (17.0) (slowdebug build )
>> # Java VM: OpenJDK 64-Bit Server VM (slowdebug 17-internal+0-adhoc.simonisv.jdk, mixed mode, sharing, tiered, compressed oops, compressed class ptrs, g1 gc, linux-amd64)
>> # Problematic frame:
>> # V  [libjvm.so+0x1244301]  PeriodicTask::PeriodicTask(unsigned long)+0x83
>> #
>> # No core dump will be written. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
>> #
>> # An error report file with more information is saved as:
>> # /priv/simonisv/output/jdk-dbg/hs_err_pid21168.log
>> #
>> #
>> Aborted
>
> oh, I don't know this constraint.  I will add a constraint check for the option.

add  a constraint for it. now it will get the error message for 13. 
java -XX:LogAsyncInterval=13 -Xlog:gc:file=/tmp/class.log::async=true -version
LogAsyncInterval (13) must be evenly divisible by PeriodicTask::interval_gran (10)
Improperly specified VM option 'LogAsyncInterval=13'
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

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

PR: https://git.openjdk.java.net/jdk/pull/3135


More information about the hotspot-dev mailing list