Help troubleshooting java process maxing CPU at 100%

Discussion in 'macOS' started by AdrianR8, Sep 12, 2011.

  1. AdrianR8, Sep 12, 2011
    Last edited: Sep 12, 2011

    AdrianR8 macrumors newbie

    Joined:
    Sep 12, 2011
    #1
    THIS IS A LONG POST. Understandably, if you don't want to bother with reading the whole thing, the next paragraph posts my actual question. Everything after that is information and troubleshooting steps I've taken.

    Hi, I'm looking for some help troubleshooting a java process that is maxing out my processor(s) at 95% to 100%. As you can imagine, it's slowing my system down tremendously. The process name is "java" and the problem typically starts when the computer starts. It occurs before starting any programs up. Does anyone know how to dig a little deeper to find out what program or system process that is calling up this problem process?

    I'm running a Macbook Pro 2.8GHz Intel Core 2 Duo with 8GB RAM running Lion OS X v10.7.1. Hard drive is 7200RPM SATA 500GB HD with 200GB free.

    Here's some points of info and troubleshooting I've done:
    1. Problem occurs on both OSX Snow Leopard v10.6 and OSX Lion 10.7.1 (format and fresh install) with all updates installed on both OS's.
    2. In terminal, I ran the command "ps -axwwwp "process id". The problem java process id varies as it changes each time the process starts back up. In the results displayed, I'll scroll to that java process id and the 'cmd' running or attempting to run is "java -Djava.awt.headless=true -jar /tmp/ics29586". The time that this process is running will vary and I'm not sure when it attempts to restart itself, but last time I checked, it was running for 30:38.80. I'm assuming that's 30 min.
    3. In Activity Monitor, I drilled down through all the parent processes of the java process and I'm not able to find out what program is starting this process. Here's the drill down of the parent processes: java (PID varies) --> cron (PID varies) --> cron (21) --> launchd (1) --> kernel task (0). But this doesn't tell me much. I ran a sample of the process but I don't understand it.
    4. I was thinking that maybe the process was hanging up on a scheduled task since one of the parent processes was the cron. I tried deleting the "ics29586" file out of the /tmp directory after ending the problem java process. That didn't work. It just recreated itself.
    5. I manually quit the process, but it starts right back up within seconds to minutes.
    6. When the process is eating up my CPU(s), I checked the hard drive and it's ok...showing minimal disk activity.
    7. I can finally get the problem process to stop coming up after quitting the process numerous times. This can take up to half the day and it's very cumbersome and interruptive. I've done this many times, but have counted the last couple times of ending the process. The first time it took 25 times and the second it took 44 times. From what I can see, it doesn't look consistent.
    8. Removed all login items and turned off Time Machine to no avail.
    9. I've removed all third party programs from the system and it's still occurring even on a bare bones or close to bare bones system.
    10. There are other java processes that run with minimal CPU usage so I don't think it's a problem with java.
    12. Hardware test results come up OK.
    13. I checked support on the java website and came up empty-handed. I've googled this issue in all sorts of ways and can't find anything. The closest thing I found was actually on MacRumors Forums. Here's the link: http://forums.macrumors.com/showthread.php?t=1196039&highlight=java+process+cpu. It's a similar issue, but I didn't want to hijack the post because the original poster is asking how to reinstall java. I don't want to reinstall because I don't think it's a problem with java. I want to further troubleshoot.
    14. Nothing changed that I can remember when this issue first started happening...no new programs or updates.
    15. I've reset SMC.
    16. I installed, updated, and ran a Sophos AV scan. No viruses found.

    Does anyone know how to troubleshoot this further? Your help is very much appreciated.
     
  2. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    Odds are this is caused by an entry in your computer's "crontab", a table that tells the cron daemon when to start things. The way to edit this table is not at all obvious - normal methods will fail, due to the table itself being hidden and requiring superuser privileges to modify. Once you figure out where the table is located (it's in a subdirectory of /etc, a hidden UNIX folder at the root of the boot drive), there are several ways to go about editing it. My favorite technique is to use nano at a Terminal window, like so:
    Code:
    sudo nano /path/to/file/to/edit/as/superuser
    You'll be prompted for your account password if you do this, and you won't be able to see what you are typing for security reasons.

    I hope this at least gives you a start on troubleshooting.
     
  3. AdrianR8 thread starter macrumors newbie

    Joined:
    Sep 12, 2011
    #3
    Thank you for the help wrldwzrd89. That gets me one step closer to troubleshooting this. I found the crontab in the root of /etc. So in Terminal I typed in the command:
    Code:
    sudo nano /etc/crontab
    The only thing I see in the crontab is "*/5 * * * * root /usr/bin/adjkerntz" (see the screenshot below). I found that the adjkerntz utility maintains the relationship between the kernel clock and the CMOS clock. On a hunch, I unchecked the "set date and time automatically" in System Preferences to see if that would have an effect. Restarted. Problem still there.

    Any other suggestions?

    Below I've also posted a couple more screenshots...one is my Activity Monitor with the problem java process pegging my processor at 99.7%. Notice there's another java process running, PID 165, showing that other java processes run normally utilizing little to none of the processor.

    The other screenshot is my process list detail when running the command "ps -axwwwp 675" in Terminal with 675 being the problem process ID and process ID 165 being the example of a java process running normally. Process ID 165 is a process called up by the program WebHelpDesk, a help desk support server software. I've already checked to see if this software is causing the problem by uninstalling it back when I had OSX Snow Leopard installed and also by not installing it back when I formatted and fresh installed OSX Lion. In both cases, that didn't help. The issue was still there.
     

    Attached Files:

  4. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #4
    That's the system crontab. There are also user crontabs - one for each user on the system. They cannot be edited directly, since you'll find you don't have permission to browse the user crontab folder. Here's how to do it, using nano (assuming you're using the default bash shell):
    Code:
    export EDITOR=/usr/bin/nano
    crontab -e
     
  5. AdrianR8, Sep 15, 2011
    Last edited: Sep 15, 2011

    AdrianR8 thread starter macrumors newbie

    Joined:
    Sep 12, 2011
    #5
    Ok I ran those commands in Terminal. There isn't anything in the user crontab.

    I checked my Terminal preferences and I am using the default login shell.

    Please see the screenshots below. Also, my user account, "Adrian", is the only user account on the system. Sorry for all the screenshots. :) I post them to be clear on what it is that I'm doing on my end.

    Thanks again for taking the time to help me troubleshoot.
     

    Attached Files:

  6. r0k macrumors 68040

    r0k

    Joined:
    Mar 3, 2008
    Location:
    Detroit
    #6
    My Mac is first and foremost my computer and I want to use it for getting stuff done. What do you mean you don't want to reinstall Java? If Java had taken over my Mac like it's taken over yours, I think I would have uninstalled or deleted the JRE a long time ago.

    The only thing on my Mac that relies on Java is Crashplan. Since I highly value Crashplan, I'm thankful I've never had problems with Java, but if it was behaving like yours, it would be gone in a heartbeat.

    You can always run Lion inside Virtualbox to do whatever you are using Java for and kill the VM when you are done so you don't have to "dirty up" your real Mac with java. Heck everybody is getting on board when it comes to virtualization. Apple allows us to virtualize Lion now and MS is shipping virtualization with Windows 8. Of course running Lion in a Virtualbox bottle gives you a chance to debug the java problem without crippling your real Mac. Once you figure out what is causing the problem in the virtualbox, you can decide whether to bring java back to your top level machine.
     
  7. AdrianR8, Sep 15, 2011
    Last edited: Sep 15, 2011

    AdrianR8 thread starter macrumors newbie

    Joined:
    Sep 12, 2011
    #7
    I can appreciate your view r0k, but the reasons I don't want to reinstall Java is:
    a) you can't do a simple uninstall of Java. I believe once it's installed on Lion, it's on for good and the only way to get rid of it is to do a time-consuming, format and fresh install of OSX. After the fresh install I would run the risk of the problem reoccurring without knowing what caused it in the first place.
    -and-
    b) I don't believe Java is the problem. It's not Java that has taken over my system, it's a particular program or process that uses Java that has taken over my system.

    What I want to do is troubleshoot it to get to the root of the problem so that I can fix it and avoid the same problem in the future. A system without Java is not an option for me. Java is used quite frequently by programs and internet pages. It's also used by one of my productivity softwares that I use daily (WebHelpDesk).

    Yeah exactly! That's what I want to do, is to find out what program is causing Java to go haywire and get rid of it!

    Thank you for the suggestion on the Virtualbox. When time permits, I may try that as a way to start over on troubleshooting from a clean install of OSX Lion. However, I'm not sure if this will help because running Lion in a Virtualbox would still cripple my system if the Java problem reoccurs because it'll still eat up my CPU. By the way, a fresh install is what I did when I initially formatted and fresh installed OSX Lion, but unfortunately, I didn't catch the cause the first time around. The Java problem started back up on the fresh install within the same day with little to no programs installed. This is my work and personal computer that I use daily 8+ hours so time is scarce for me to do what you're suggesting.

    I also don't want to use Virtualbox as a permanent solution...I really shouldn't have to. As mentioned above, Java is used by me far too frequently to have to keep turning a VM on and off throughout the day. Doing that would actually be more interruptive than what I'm currently having to do which is ending the process numerous time before the process finally stops coming back up.

    So this is still an open issue. I don't want to stray away from the current troubleshooting of my system as it stands. With the knowledge of others, I could be one step away from finding and fixing the culprit. That sounds more desirable than going thru the steps of fresh installing OSX, programs, configuring, and/or VM.

    Thanks again.
     
  8. nfable macrumors regular

    nfable

    Joined:
    Apr 9, 2007
    #8
    This was my issue...

    I was getting crazy Java activity with no identifiable program running them; then after some weeding around I found it was software I had installed from http://www.theskynet.org for which is a distributed computing thingamajig that uses your cpu to process data for astronomy projects.

    Pretty cool, but it placed Nereus on my system which is the engine that runs thru Java. I followed the removal instructions and no more 100% Java time! Thought it worth a mention.

    nf

    from the skynet.org
    I’d like to uninstall the Mac software and run it through the website again, how do I do that?
    Use spotlight (search) to search for Nereus and then click on the ‘Uninstall NereusV’ to uninstall the automatic client.

    I’d like to uninstall the PC software and run it through the website again, how do I do that?
    Use the ‘Add or Remove Programs’ from the Control Panel to uninstall theSkyNet client.
     

Share This Page