Fedora Linux Support Community & Resources Center
  #16  
Old 15th December 2012, 04:08 PM
rocketraman Offline
Registered User
 
Join Date: Nov 2012
Location: Ottawa
Posts: 8
linuxchrome
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

@wangmaster: Agreed.

I'm still seeing this on the latest F16 kernel:

# uname -a
Linux edison 3.6.7-4.fc16.x86_64 #1 SMP Tue Nov 20 20:33:31 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Reply With Quote
  #17  
Old 3rd January 2013, 04:53 PM
rocketraman Offline
Registered User
 
Join Date: Nov 2012
Location: Ottawa
Posts: 8
linuxchrome
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

Still happening on 3.6.10:

Code:
# uname -a
Linux edison 3.6.10-2.fc16.x86_64 #1 SMP Tue Dec 11 18:55:03 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Does anyone have any links to any upstream bug reports or mailing lists where this issue is being discussed? Here are some links I have found, but neither contains any upstream / root cause info:

http://structureddata.org/2012/06/18...oop-workloads/
http://bugs.centos.org/view.php?id=5716

Last edited by rocketraman; 3rd January 2013 at 05:04 PM.
Reply With Quote
  #18  
Old 5th January 2013, 08:27 PM
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 6,050
linuxfirefox
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

What java process is it that's running? A typical Fedora system doesn't have Java code running very much. The browser will run the plugin for java occasionally.


Running 'jvisualvm' will let you use VisualVM to examine the java vm.
Just run "jvisualvm" from a terminal and
from the Applications page on the left side, pick the entry under the "Local" label that's not VisualVM,
it's likely the only other one in the list and just below it.
With it selected, right mouse click it and pick "Open". Now you should have tabs on the right of the tool showing the "Overview", "Monitor", "Threads", "Sampler" and "Profiler".
Go to the Overview and in the "System properties" the "user.dir" will show you where the java class is running from and "sun.java.command" will be the name of the class.

Another option is:
Quote:
jstack `pgrep java`
which will show the stack of the process, only do that if `pgrep java` only shows one pid. From the jstack listing, you can frequently see what the "main" is doing (the main function) and what the class is called (bolded here). Here is the main jstack listing for a simple class I wrote that just sleeps in a thread:
Quote:
"main" prio=10 tid=0x00007ffabc007800 nid=0x5cc6 waiting on condition [0x00007ffac15f4000]
java.lang.Thread.State: TIMED_WAITING (sleeping)
at java.lang.Thread.sleep(Native Method)
a Test.main(Test.java:8)
PS. you'll only have jstack and jvisualvm available on your system if you have the JDK installed

Last edited by marko; 5th January 2013 at 08:29 PM.
Reply With Quote
  #19  
Old 5th January 2013, 09:49 PM
dciarnie Offline
Registered User
 
Join Date: Jun 2004
Posts: 102
linuxfirefox
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

You are quite right that a typical Fedora system does not have many, if any, Java processes running but this isn't about unknown java processes.

The problem is that ever since kernel 3.5.x came out, CPU usage on all cores goes to 100% when running javac (but seemingly only when the system has been running for some time). The issue seems to be transparent huge pages since disabling defrag eliminates the problem. This problem was not present with the 3.4.x kernels and since I haven't changed the version of Java that I've been using, the cause would seem to be huge pages, not Java.

Note that I am intentionally referring to javac and not java since I have only noticed the problem with builds and my IDE, not with running the code. The problem may still be there with java but the build process places more demands on the system.

Note that I have submitted a bug report on the Redhat bugzilla site: https://bugzilla.redhat.com/show_bug.cgi?id=892212
Reply With Quote
  #20  
Old 5th January 2013, 10:09 PM
marko Offline
Registered User
 
Join Date: Jun 2004
Location: Laurel, MD USA
Posts: 6,050
linuxfirefox
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

Quote:
Note that I am intentionally referring to javac
Okay, apparently this is the first time in the thread that someone specifically said it was only javac that runs 100% on the cpu and not the "java process" as was stated in post #1. So the problem only occurs during the compile of Java code?

I've not seen this problem but I almost never use the openjdk JDK, I usually compile with the Oracle JDK (currently using 1.7.0u10 and 1.8.0-ea (JDK 8 early access). Is everyone seeing this only using Openjdk? I see post #4 suggests the JDK maker doesn't matter so this would suggest some kind of common memory algorithm is a problem.

Last edited by marko; 5th January 2013 at 10:13 PM.
Reply With Quote
  #21  
Old 5th January 2013, 11:03 PM
dciarnie Offline
Registered User
 
Join Date: Jun 2004
Posts: 102
linuxfirefox
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

I am also using Oracle's java but I'm using 1.6.
Reply With Quote
  #22  
Old 11th January 2013, 04:26 PM
wangmaster Offline
Registered User
 
Join Date: Nov 2008
Posts: 145
linuxchrome
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

I've noticed it in both javac and java processes. I'm a developer for a large application server that is generally configured for huge amounts of heap. I tend to run -Xmx2048m for development.

And yeah, both compilation and the java processes cause it to go out to lunch.

We've noticed cases where khugepaged actually starts to consume CPU too. From what research I was able to dig up, that does periodic defrag. I've considered disabling that (although the risk there is memory fragmentaiton causing effectively memory "loss") or completely disabling transparent huge pages.
Reply With Quote
  #23  
Old 22nd August 2013, 05:36 PM
bnolsen Offline
Registered User
 
Join Date: Mar 2006
Posts: 3
linuxfirefox
Re: 100% CPU consumption with 3.6.2-4 kernel and Java

I have high performance highly threaded software all written in c++ which loads and processes imagery. This problem is utterly killing me. What's worse is that one of our software packages can be downloaded and run by end users in demo mode (not requiring root to install).

So a customer can pull down our linux tarball to test it, drop it in and *poof* spinlock kill their system. And I have to go through a long explanation as to why it's the fault of the kernel developers and distribution maintainers and they have to do all this song and dance to stop huge page defragmentation if they want to run our demo program. This goes over like a lead brick.

The bad part is the first customer we had who wanted to explore migrating to linux installed like 5 different linux distros (including fedora) and all of them tanked with this problem. Thankfully I figured out "perf top" and was finally able to identify why everything was tanking. But that one customer abandoned looking at linux entirely.
Reply With Quote
Reply

Tags
100%, consumption, cpu, java, kernel

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
64 bit power consumption LinuxHippy Using Fedora 7 4th November 2005 05:50 AM
CPU consumption luca Using Fedora 3 27th August 2004 12:14 PM


Current GMT-time: 15:53 (Friday, 19-09-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat