Samuel Hapak
Samuel Hapak

Reputation: 7202

Java is using 100% of cpu on linux

On my linux server, any java program (even the "Hello world") uses 100% of cpu and is very very slow. Id does not depend on the java version, I have tried different versions of openjdk and sun jdk, both behave the same. How could I fix that?

Upvotes: 6

Views: 10109

Answers (1)

Samuel Hapak
Samuel Hapak

Reputation: 7202

I have found the solution in this article http://blog.wpkg.org/2012/07/01/java-leap-second-bug-30-june-1-july-2012-fix/

There is a great chance, this is caused by the "leap second kernel bug". Firstly, check for the following in the dmesg

[10703552.860274] Clock: inserting leap second 23:59:60 UTC

To fix it, firstly stop the ntp client. On debian-like systems

/etc/init.d/ntp stop

Store the current time

date -s now

And test the java. If everything is working correctly, try to restart ntp service

/etc/init.d/ntp start

And test it again.

Upvotes: 11

Related Questions