Results 1 to 6 of 6
  1. #1
    mr_empty is offline Member
    Join Date
    Mar 2008
    Posts
    15
    Rep Power
    0

    Default run java program in 100% usage

    hi all,
    does anybody know how to run a java program in 100% cpu usage? thanks!

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,008
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by mr_empty View Post
    hi all,
    does anybody know how to run a java program in 100% cpu usage? thanks!
    You can't because the CPU is 100% busy doing other things.

    kind regards,

    Jos

  3. #3
    coltragon is offline Senior Member
    Join Date
    Dec 2009
    Posts
    104
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    You can't because the CPU is 100% busy doing other things.

    kind regards,

    Jos
    i think he means how to let your program use the maximal cpu possible
    (feels scared of going into advanced java section :P)
    Beginner in Java Programming, Please don't trust my anwsers blind please :D

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    nice/renice? In Windows the task manager lets you alter the priority of the various running tasks - it gives you a warning about "system instability" that should probably be taken heed of...

  5. #5
    aaroncarpet's Avatar
    aaroncarpet is offline Senior Member
    Join Date
    Nov 2009
    Location
    California
    Posts
    147
    Rep Power
    0

    Default

    I have 2 cores, and if my java program has only one thread it only uses 50%. If I run 2 instances of the java program then it uses 100%. The JVM will only use 100% if it needs to. It must be a hefty task and more than one native thread.

  6. #6
    senorbum is offline Member
    Join Date
    Aug 2009
    Posts
    76
    Rep Power
    0

    Default

    Yeah, if its some single threaded app it makes no sense to try to use 100%, because modern cpus are multi-cored. If you make a multithreaded app (say 1 thread for each available core) it will use 100% cpu.

Similar Threads

  1. How to determine CPU usage using Java?????
    By JavaEmpires in forum New To Java
    Replies: 5
    Last Post: 03-16-2011, 04:49 AM
  2. usage of Hashtable
    By venu2807 in forum New To Java
    Replies: 4
    Last Post: 01-27-2009, 03:36 AM
  3. Timer usage in java program
    By sandeeprao.techno in forum New To Java
    Replies: 5
    Last Post: 01-24-2008, 07:16 PM
  4. Integer Usage
    By bluegreen7hi in forum New To Java
    Replies: 11
    Last Post: 01-24-2008, 08:54 AM
  5. Comm API Usage
    By hobbyist in forum New To Java
    Replies: 0
    Last Post: 11-16-2007, 04:59 PM

Posting Permissions

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