Do not use on any
shared computer
May 16, 2008 11:35pm pdt
04.09.2008 at 08:29AM PDT, ID: 23308523 | Points: 500
[x]
Attachment Details
JVM time drifting
HP_UX OS time varies from Websphere systemout log.

 Why OS time(date) different from systemout log.

When i restart servers, its getting OS time. However, its drifting 2 minutes after one day... I greatly appreciate anyone inputs.
Start your free trial to view this solution
Question Stats
Zone: Software
Question Asked By: wasuser
Question Asked On: 04.09.2008
Participating Experts: 2
Points: 500
Views: 0
Translate:
Loading Advertisement...
04.09.2008 at 08:31AM PDT, ID: 21315984

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 08:33AM PDT, ID: 21315998

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 08:40AM PDT, ID: 21316074

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 09:05AM PDT, ID: 21316311

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 09:31AM PDT, ID: 21316546

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 09:34AM PDT, ID: 21316568

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 09:40AM PDT, ID: 21316626

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 09:48AM PDT, ID: 21316700

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 10:03AM PDT, ID: 21316844

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 10:32AM PDT, ID: 21317093

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 12:02PM PDT, ID: 21317989

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 12:10PM PDT, ID: 21318060

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 12:26PM PDT, ID: 21318206

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 12:36PM PDT, ID: 21318284

Rank: Genius

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 12:42PM PDT, ID: 21318327

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 12:51PM PDT, ID: 21318404

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.09.2008 at 01:01PM PDT, ID: 21318494

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.10.2008 at 05:04AM PDT, ID: 21323734

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.10.2008 at 08:41AM PDT, ID: 21326030

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
04.10.2008 at 10:00AM PDT, ID: 21326939

All comments and solutions are available to Premium Service Members only.

Start your 7 day free trial and see for yourself why Experts Exchange is the easiest and most proven technology resource in the world. Get Started

Already a member? Login to view this solution.

 
 
Loading Advertisement...
Microsoft
  • Internet Protocols
  • Applications
  • Development
  • OS
  • Hardware
  • Windows Security
Apple
  • Operating Systems
  • Hardware
  • Programming
  • Networking
  • Software
Internet
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Spy / Ad Blockers
  • Web Browsers
  • New Net Users
  • Web Development
  • Chat / IM
  • Anti Spam
  • Web Servers
  • Anti-Virus
  • Email Clients
Gamers
  • Tips
  • Online / MMORPG
  • Puzzle
  • Emulators
  • Action / Adventure
  • Role Playing
  • Consoles
  • Game Programming
  • Strategy
  • Sports
  • Misc
  • Computer Games
Digital Living
  • Hardware
  • New Net Users
  • New Users
  • Software
  • Digital Music
  • Gaming World
  • Home Security
  • Apple
  • Networking Hardware
Virus & Spyware
  • Vulnerabilities
  • IDS
  • Encryption
  • Anti-Virus
  • Operating Systems Security
  • Software Firewalls
  • WebApplications
  • Cell Phones
  • Operating Systems
  • Internet
  • Hardware Firewalls
Hardware
  • Handhelds / PDAs
  • Displays / Monitors
  • Components
  • Networking Hardware
  • Peripherals
  • Laptops/Notebooks
  • Storage
  • Servers
  • Desktops
  • New Users
  • Misc
  • Apple
Software
  • System Utilities
  • Industry Specific
  • Network Management
  • Photos / Graphics
  • Page Layout
  • VMWare
  • Misc
  • Web Development
  • OS
  • CYGWIN
  • Voice Recognition
  • Message Queue
  • Quality Assurance
  • Security
  • Firewalls
  • MultiMedia Applications
  • Development
  • Database
  • Office / Productivity
  • Business Management
  • OS/2 Apps
  • Server Software
  • Internet / Email
ITPro
  • OS
  • Storage
  • Encryption
  • Operating Systems Security
  • Apple Hardware
  • Laptops & Notebooks
  • Servers
  • Networking Hardware
  • Peripherals
  • Devices
  • Displays / Monitors
  • WebTrends / Stats
  • Search Engines
  • Firewalls
  • WebApplications
  • IDS
  • Vulnerabilities
  • Email Clients
  • File Sharing
  • Spy / Ad Blockers
  • Web Browsers
  • Web Servers
  • Networking
  • Anti-Virus
  • Chat / IM
  • Anti Spam
Developer
  • Web Servers
  • Web Browsers
  • Game Programming
  • Dev Tools
  • Industry Specific
  • Office / Productivity
  • Database
  • CYGWIN
  • Web Development
  • Search Engines
  • File Sharing
  • WebTrends / Stats
  • Programming
  • Content Management
  • Application Servers
  • Protocols
Storage
  • Removable Backup Media
  • Storage Technology
  • Servers
  • Grid
  • Remote Access
  • Backup / Restore
  • Misc
  • Hard Drives
OS
  • Miscellaneous
  • Security
  • Development
  • Linux
  • VMWare
  • MainFrame OS
  • Unix
  • Apple
  • OS / 2
  • AS / 400
  • BeOS
  • Microsoft
  • VMS / OpenVMS
Database
  • Oracle
  • Miscellaneous
  • MySQL
  • Software
  • Sybase
  • Contact Management
  • PostgreSQL
  • Data Manipulation
  • Clarion
  • InterSystems Cache
  • Siebel
  • MUMPS
  • OLAP
  • SQLBase
  • SAS
  • GIS & GPS
  • 4GL
  • Berkeley DB
  • DB2
  • Informix
  • Interbase / Firebird
  • FoxPro
  • Reporting
  • LDAP
  • Filemaker Pro
  • MS SQL Server
  • dBase
  • MS Access
Security
  • Misc
  • Web Browsers
  • Software Firewalls
  • Operating Systems Security
  • File Sharing
  • Spy / Ad Blockers
  • Vulnerabilities
  • WebApplications
  • IDS
  • Anti-Virus
  • Encryption
  • Anti Spam
  • Email Clients
  • VPN
  • Chat / IM
Programming
  • Editors IDEs
  • Installation
  • Handhelds / PDAs
  • Multimedia Programming
  • System / Kernel
  • Algorithms
  • Game
  • Signal Processing
  • Project Management
  • Open Source
  • Database
  • Misc
  • Languages
  • Processor Platforms
  • Theory
Web Development
  • Scripting
  • Blogs
  • Web Servers
  • Software
  • Search Engines
  • Web Graphics
  • Images
  • Internet Marketing
  • Images and Photos
  • Components
  • Document Imaging
  • Web Languages/Standards
  • Illustration
  • WebApplications
  • Fonts
  • WebTrends / Stats
  • Authoring
  • Digital Camera Software
  • Miscellaneous
Networking
  • Protocols
  • Apple Networking
  • Network Management
  • Message Queue
  • Application Servers
  • Content Management
  • File Servers
  • Email Servers
  • Misc
  • Java Editors & IDEs
  • Wireless
  • Networking Hardware
  • Backup / Restore
  • System Utilities
  • ISPs & Hosting
  • Web Servers
  • Storage Technology
  • Removable Backup Media
  • Servers
  • Broadband
  • Grid
  • OS / 2
  • Novell Netware
  • Unix Networking
  • Windows Networking
  • Security
  • Telecommunications
  • Operating Systems
  • Linux Networking
Other
  • Community Advisor
  • Lounge
  • Community Support
  • New Net Users
  • Philosophy / Religion
  • Math / Science
  • Miscellaneous
  • URLs
  • Expert Lounge
  • Politics
  • Puzzles / Riddles
Community Support
  • Suggestions
  • New to EE
  • New Topics
  • Community Advisor
  • CleanUp
  • Announcements
  • General
  • Feedback
  • Input
  • EE Bugs
 
04.09.2008 at 08:31AM PDT, ID: 21315984

Rank: Genius

Are you sure you're looking at system time on the OS and not hardware time?
 
04.09.2008 at 08:33AM PDT, ID: 21315998
I hope, i am looking at OS time by using "date" command .... How can i check Hardware time????

Thanks for any inputs...
 
04.09.2008 at 08:40AM PDT, ID: 21316074

Rank: Genius

Yes, you would be. I've never come across this before. I would check to see if you can reproduce it in *any* java program
 
04.09.2008 at 09:05AM PDT, ID: 21316311
Please pardon my dumb question

From where Systemout log timestamp getting ?????

Why its drifting from Unix date command?

Thanks


 
04.09.2008 at 09:31AM PDT, ID: 21316546

Rank: Genius

Java's meant to get it from the system. How far does it differ right now?
 
04.09.2008 at 09:34AM PDT, ID: 21316568
3 minutes after 40 hours ....
 
04.09.2008 at 09:40AM PDT, ID: 21316626

Rank: Genius

That could be due to threading issues. The time may be got but unable to print immediately. Run the following and tell me what the difference is:
1:
2:
3:
4:
5:
public class DatePrinter {
    public static void main(String[] args) {
        System.out.println(new java.util.Date());
    }
}
Open in New Window
 
04.09.2008 at 09:48AM PDT, ID: 21316700
When i use follwoing TimeTest class:

//TimeTest.java
import java.util.Date;
public class TimeTest
{
    public static void main(String[] args)
    {
        System.out.println(new Date());
    }
}

RESULTS:
-----------
Wed Apr 09 12:45:58 EDT 2008

Date command results as follows:
Wed Apr  9 12:46:01 2008

When i start Application servers .... i am getting same time as OS time (date) .... However, if it is runs for 2 days then we can see 3 minutes drifting .... I am guessing May be JVM calculte time with CPU clicks ....

 
04.09.2008 at 10:03AM PDT, ID: 21316844

Rank: Genius

You could try the following and see if that delta grows
1:
while [ true ];do date >>/tmp/clock.log;java TimeTest >>/tmp/clock.log;sleep $((60 * 30));done
Open in New Window
 
04.09.2008 at 10:32AM PDT, ID: 21317093
I am running that script ..... i let you know how it goes!!!
 
04.09.2008 at 12:02PM PDT, ID: 21317989
Out put of that script:

Wed Apr  9 13:27:02 2008
Wed Apr 09 13:27:02 EDT 2008
Wed Apr  9 13:57:05 2008
Wed Apr 09 13:57:05 EDT 2008
Wed Apr  9 14:27:08 2008
Wed Apr 09 14:27:08 EDT 2008
Wed Apr  9 14:57:10 2008
Wed Apr 09 14:57:11 EDT 2008

see 1 second drifted for 1:30 hour

Thanks

 
04.09.2008 at 12:10PM PDT, ID: 21318060

Rank: Genius

>>see 1 second drifted for 1:30 hour

I think you can call that 'no drift' ;-)

That was what i expected
 
04.09.2008 at 12:26PM PDT, ID: 21318206
I didn't get you ... However, why we are getting 1 second diffence ?
 
04.09.2008 at 12:36PM PDT, ID: 21318284

Rank: Genius

1 second is by no means surprising, especially since the two different 'programs' run serially
 
04.09.2008 at 12:42PM PDT, ID: 21318327
OK ... i will let it run and see how it goes!!!

While googling, i found follwoing link ... in Reply 17 someone mentioned some patches .... Do you have any idea what are those ....????

http://forum.java.sun.com/thread.jspa?threadID=765165&start=15&tstart=0

Thank you very much!!!!
 
04.09.2008 at 12:51PM PDT, ID: 21318404
Okay, you found the thread that states that the HP JVM maintains its own internal clock, which is pretty dumb if you ask me. However, it says that if you start the JVM with the "-XX:+UseGetTimeOfDay" flag, it will revert to using the system clock. Have you tried that?
 
04.09.2008 at 01:01PM PDT, ID: 21318494
OK ...

1. When i restart my Application servers .. OS time match with Systemout logs ....
2.  After one day ...  difference between my OS time (running on HP-UX) and JVM time (represented by my app servers) is around 2 minutes...

Thanks in advance
 
04.10.2008 at 05:04AM PDT, ID: 21323734
Was that last comment with out without the suggested flag?
 
04.10.2008 at 08:41AM PDT, ID: 21326030
Without flag!!!!

Do you want me start JVM with "-XX:+UseGetTimeOfDay" as command line argument?
 
04.10.2008 at 10:00AM PDT, ID: 21326939
Yes!!!!
 
 
20080206-EE-VQP-25 / EE_QW_2_20070628