RFR: 8261768: SelfDestructTimer should accept seconds

Gerard Ziemski gziemski at openjdk.java.net
Mon May 23 19:10:08 UTC 2022


The Java VM supports a runtime flag called `SelfDestructTimer`, which if used, will automatically terminate the java process using the value, expressed in minutes.

This flag is very useful when, for example, working on VM startup performance, as it allows a sampling tool to capture the exact same time interval for clear comparison of before and after optimizations.

The only problem is that the minimum value of 1 minutes is a really long time for a computer and any data captured during that minute will have many samples to filter through.

This fix allows SelfDestructTimer to accept a fractional value of minutes, which in practical terms allows for values to be expressed as seconds, which allows more flexible control.

For example:

- `XX:SelfDestructTimer=0.0` means that the feature is **off** (default, unchanged)
- `XX:SelfDestructTimer=0.25` means **15 seconds**
- `XX:SelfDestructTimer=0.5` means **30 seconds**
- `XX:SelfDestructTimer=1.0` means **1 minute**

The implementation keeps the old semantics, so that`XX: SelfDestructTimer=1` behavior, for example, is unchanged.

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

Commit messages:
 - Extend SelfDestructTimer to accept fractional minutes

Changes: https://git.openjdk.java.net/jdk/pull/8849/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8849&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8261768
  Stats: 7 lines in 2 files changed: 1 ins; 0 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8849.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8849/head:pull/8849

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


More information about the hotspot-runtime-dev mailing list