Fwd: openjdk runtime consumes almost 100% cpu on Thread.sleep call
Aditya Ilkal
adityailkal at gmail.com
Wed Aug 16 07:59:52 UTC 2017
HI,
Can you help me to reach the right team for the below issue?
We are running openjdk with below version on android os (Linux localhost
4.9.31-android-x86)
*openjdk version "9-internal"*
*OpenJDK Runtime Environment (build 9-internal+0-adhoc.aditi.dev)*
*OpenJDK Client VM (build 9-internal+0-adhoc.aditi.dev, mixed mode)*
The following is the program
public static void main(String[] args) throws Throwable {
while(true) {
System.out.println("sd123");
Thread.sleep(30000);
System.out.println("sd12");
Thread.sleep(10000);
}
}
The processes details on the OS is as below.
*Main Process*
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
7206 28501 root S 869m 24.6 0 87.8 /etc/jdk8/images/jre/bin/java
*Threads of above process*
PID PPID USER STAT VSZ %VSZ CPU %CPU COMMAND
7208 28501 root R 869m 24.6 0 13.7 {VM Thread}
7207 28501 root R 869m 24.6 1 13.3 /etc/jdk8/images/jre/bin/java
7212 28501 root R 869m 24.6 0 12.8 {C1 CompilerThre}
7222 28501 root R 869m 24.6 1 12.6 {VM Periodic Task thread}
7216 28501 root R 869m 24.6 1 12.3 {Sweeper thread}
7217 28501 root R 869m 24.6 1 11.7 {Common-Cleaner}
The same application when run on Ubuntu linux runs very well and the thread
state of above threads is 'S', where as in android os, it is shown as R and
consuming CPU.
Also, the output "sd12" which should print after waiting 30 s, is taking
more time. This just means sleep interval is not getting calculated
correctly.
This can be easily reproducible, hence request you to look in to this issue
and provide possible insights.
Thanks,
Aditya Ilkal
More information about the jdk9-all-changes
mailing list