Results 1 to 2 of 2
  1. #1
    userj2ee is offline Member
    Join Date
    May 2010
    Posts
    9
    Rep Power
    0

    Question How to get a System's total CPU usage percentage using a java program

    Hi,

    I need to find the system's total CPU usage percentage ( as we see in Windows Task Manager) using a java program. I am able to find the CPU usage time for one process using the OperatingSystemMXBean API. But i am not able to find a way to find the CPU usage percentage for all the process running on a system.
    I cannut use any third party tools to acheive this. Are there any third party jars available which can help me in getting this data?

    Thanks
    Prachi

  2. #2
    toadaly is offline Senior Member
    Join Date
    Jan 2009
    Posts
    671
    Rep Power
    6

    Default

    There are tons of 3rd party system performance monitors available, such as PerfAnal, but if I were tasked with this problem, I'd write a dirt simple native app that just spits total cpu usage out to stdout, and then I'd exec it in java and read the results.

Similar Threads

  1. Replies: 1
    Last Post: 03-29-2010, 02:07 AM
  2. run java program in 100% usage
    By mr_empty in forum Advanced Java
    Replies: 5
    Last Post: 01-22-2010, 11:35 PM
  3. get percentage formatting to display 2 decimal places
    By gotenks05 in forum New To Java
    Replies: 5
    Last Post: 03-03-2009, 05:57 PM
  4. Percentage/decimal points?
    By Exhonour in forum New To Java
    Replies: 6
    Last Post: 01-16-2009, 11:35 PM
  5. Timer usage in java program
    By sandeeprao.techno in forum New To Java
    Replies: 5
    Last Post: 01-24-2008, 08:16 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •