1

I want to know JVM options used to synchronize time between Java application and system. Like UseHighResolutionTimer and UseGetTimeOfDay

I had a problem that the time between Java Application and the system did not match. So, I searched for JVM option about time sync, and I found UseHighResolutionTimer and UseGetTimeOfDay.

https://support.hpe.com/hpsc/doc/public/display?docId=mmr_kc-0115106

However, this document is about HP-UX. I use both HP and IBM. Does this option apply to IBM?
In addition, in that document contains only three settings:
+ UseHighResolutionTimer, -UseGetTimeOfDay & & -UseHighResolutionTimer, + UseGetTimeOfDay.
Does any other settings exist?
Is there option like "Synchronize every 24 hours"?

윤장현
  • 11
  • 2
  • HotSpot JVM has neither `UseHighResolutionTimer` nor `UseGetTimeOfDay` option. So you might be looking at the wrong thing, or the question should not be tagged with `jvm-hotspot`. Anyway, it worth adding information about JDK and OS versions used. – apangin Jan 21 '19 at 08:33

1 Answers1

1

The JVM simply uses time values that it gets from the operating system. It is not the JVM's concern to keep clocks in sync. That's the operating system's problem. (And indeed, adjusting the system clock typically requires admin privilege, and you probably don't want your applications to be running with that privilege ...)

The normal way to deal with this is to install software that will sync the system clock with an external time source. For example, on Linux you would typically install "ntpd" and configure it to sync with a network time server.

Note that these utilities are common to all versions of Linux, and probably versions UNIX as well.

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216