Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Increase WinXP/jre CPU usage?

Reply
Thread Tools

Increase WinXP/jre CPU usage?

 
 
Steve Brecher
Guest
Posts: n/a
 
      11-13-2006
I have a compute-intensive program with a simple console user interface.
While the program is running (number crunching), WinXP's Task Manager's CPU
usage for it never goes above 50%. I'd like to use the other half of my CPU
I've tried, via a separate SetPriority utility, setting the java (JVM)
process priority to 256 (max; real time) and all of its threads' priorities
to 15 (max). This causes the JVM's Base Prio entry in Task Manager to
become Real Time -- but CPU usage remains at 50%.

The code that is running does no I/O, only calculation.

--
For mail, please use my surname where indicated:
(Steve Brecher)


 
Reply With Quote
 
 
 
 
Thomas Kellerer
Guest
Posts: n/a
 
      11-14-2006


Steve Brecher wrote on 14.11.2006 00:47:
> I have a compute-intensive program with a simple console user interface.
> While the program is running (number crunching), WinXP's Task Manager's CPU
> usage for it never goes above 50%. I'd like to use the other half of my CPU
> I've tried, via a separate SetPriority utility, setting the java (JVM)
> process priority to 256 (max; real time) and all of its threads' priorities
> to 15 (max). This causes the JVM's Base Prio entry in Task Manager to
> become Real Time -- but CPU usage remains at 50%.
>
> The code that is running does no I/O, only calculation.
>

Do you happen to have a dual processor/dual core computer? If so, then I suspect
your calculation is running in a single thread only which will not make use of
the second processor, and thus your overal CPU load will not exceed 50%

Thomas
 
Reply With Quote
 
 
 
 
Patricia Shanahan
Guest
Posts: n/a
 
      11-14-2006
Steve Brecher wrote:
> I have a compute-intensive program with a simple console user interface.
> While the program is running (number crunching), WinXP's Task Manager's CPU
> usage for it never goes above 50%. I'd like to use the other half of my CPU
> I've tried, via a separate SetPriority utility, setting the java (JVM)
> process priority to 256 (max; real time) and all of its threads' priorities
> to 15 (max). This causes the JVM's Base Prio entry in Task Manager to
> become Real Time -- but CPU usage remains at 50%.
>
> The code that is running does no I/O, only calculation.
>


Is there any possibility that you have a dual processor, possibly two
cores in one chip?

Utilization freezing at close to 50%, even at very high priority, for a
compute intensive job is typical of running a single threaded
application on a dual processor.

If that is what is going on, you should be able to run two copies of the
job (if it does not use too much memory) at the same time almost as fast
as one copy. If so, look at parallelizing the compute-bound portion of
the job.

What dominates the computation? Some algorithms are easier to
parallelize than others.

Patricia
 
Reply With Quote
 
Steve Brecher
Guest
Posts: n/a
 
      11-14-2006
Thomas Kellerer <> wrote:
> Steve Brecher wrote on 14.11.2006 00:47:
>> I have a compute-intensive program with a simple console user
>> interface. While the program is running (number crunching), WinXP's
>> Task Manager's CPU usage for it never goes above 50%. ...
>>

> Do you happen to have a dual processor/dual core computer? If so,
> then I suspect your calculation is running in a single thread only
> which will not make use of the second processor, and thus your overal
> CPU load will not exceed 50%


(Thanks also to Patricia, who responded similarly.)

It's a Pentium 4 (3.4G) vintage early 2004. If it's dual, I never knew it!
Might it be?

The calculation is definitely single-thread.

--
For mail, please use my surname where indicated:
(Steve Brecher)


 
Reply With Quote
 
Luc The Perverse
Guest
Posts: n/a
 
      11-14-2006
"Steve Brecher" <see.signature@end> wrote in message
news:...
>I have a compute-intensive program with a simple console user interface.
>While the program is running (number crunching), WinXP's Task Manager's CPU
>usage for it never goes above 50%. I'd like to use the other half of my
>CPU I've tried, via a separate SetPriority utility, setting the java
>(JVM) process priority to 256 (max; real time) and all of its threads'
>priorities to 15 (max). This causes the JVM's Base Prio entry in Task
>Manager to become Real Time -- but CPU usage remains at 50%.
>
> The code that is running does no I/O, only calculation.


Do you by chance have a dual core system?

--
LTP




 
Reply With Quote
 
=?ISO-8859-1?Q?Arne_Vajh=F8j?=
Guest
Posts: n/a
 
      11-14-2006
Steve Brecher wrote:
> Thomas Kellerer <> wrote:
>> Steve Brecher wrote on 14.11.2006 00:47:
>>> I have a compute-intensive program with a simple console user
>>> interface. While the program is running (number crunching), WinXP's
>>> Task Manager's CPU usage for it never goes above 50%. ...
>>>

>> Do you happen to have a dual processor/dual core computer? If so,
>> then I suspect your calculation is running in a single thread only
>> which will not make use of the second processor, and thus your overal
>> CPU load will not exceed 50%

>
> (Thanks also to Patricia, who responded similarly.)
>
> It's a Pentium 4 (3.4G) vintage early 2004. If it's dual, I never knew it!
> Might it be?
>
> The calculation is definitely single-thread.


No it is single core.

BUT it has hyperthreading.

Which in WinXP task manager looks like 2 CPU's !

And to utilize HT you still need to multithread.

Arne
 
Reply With Quote
 
Luc The Perverse
Guest
Posts: n/a
 
      11-14-2006
"Patricia Shanahan" <> wrote in message
news:YT76h.5963$ ink.net...
> Steve Brecher wrote:
>> I have a compute-intensive program with a simple console user interface.
>> While the program is running (number crunching), WinXP's Task Manager's
>> CPU usage for it never goes above 50%. I'd like to use the other half of
>> my CPU I've tried, via a separate SetPriority utility, setting the
>> java (JVM) process priority to 256 (max; real time) and all of its
>> threads' priorities to 15 (max). This causes the JVM's Base Prio entry
>> in Task Manager to become Real Time -- but CPU usage remains at 50%.
>>
>> The code that is running does no I/O, only calculation.
>>

>
> Is there any possibility that you have a dual processor, possibly two
> cores in one chip?
>
> Utilization freezing at close to 50%, even at very high priority, for a
> compute intensive job is typical of running a single threaded
> application on a dual processor.
>
> If that is what is going on, you should be able to run two copies of the
> job (if it does not use too much memory) at the same time almost as fast
> as one copy. If so, look at parallelizing the compute-bound portion of
> the job.
>
> What dominates the computation? Some algorithms are easier to
> parallelize than others.


Utilizing multiple processors/cores to do tasks which seem to be iterative
(I'm sure there is probably a more formal/correct way to say this) is a very
active and fun area of computer science right now!

--
LTP




 
Reply With Quote
 
Steve Brecher
Guest
Posts: n/a
 
      11-14-2006
Patricia Shanahan <> wrote:
> Is there any possibility that you have a dual processor, possibly two
> cores in one chip?


It seems I do, virtually speaking -- Pentium 4, apparently with
Hyper-Threading Technology (thanks to Arne Vajhøj in
<45591a39$0$49200$>).

> Utilization freezing at close to 50%, even at very high priority, for
> a compute intensive job is typical of running a single threaded
> application on a dual processor.
>
> If that is what is going on, you should be able to run two copies of
> the job (if it does not use too much memory) at the same time almost
> as fast as one copy. If so, look at parallelizing the compute-bound
> portion of the job.
>
> What dominates the computation? Some algorithms are easier to
> parallelize than others.


It's nested loops enumerating cases; there's a computation for each case,
i.e., inside the innermost loop, and the computation results are
accumulated.

It should be possible to dual-thread it, e.g., one thread doing the odd
cases, so to speak, and the other the even ones. I could synchronize access
to the accumulation structures, or perhaps have two of them. For generality
maybe I can even N-thread it. I'll have to think about this...

--
For mail, please use my surname where indicated:
(Steve Brecher)


 
Reply With Quote
 
Patricia Shanahan
Guest
Posts: n/a
 
      11-14-2006
Steve Brecher wrote:
....
> It's nested loops enumerating cases; there's a computation for each case,
> i.e., inside the innermost loop, and the computation results are
> accumulated.
>
> It should be possible to dual-thread it, e.g., one thread doing the odd
> cases, so to speak, and the other the even ones. I could synchronize access
> to the accumulation structures, or perhaps have two of them. For generality
> maybe I can even N-thread it. I'll have to think about this...
>


Given trends in computer architecture, I suggest N-threading it while
you are about it. When you go to replace that computer, you may find
yourself getting something with multiple cores, each multi-threaded.

For reduction problems (problems that take a long vector and produce a
single answer, such as adding things up), it is generally better, if
permitted by the problem, to have an accumulator for each thread, and
only add them at the end. The less synchronization in the middle of the
problem, the faster it will go.

Consider organizing the work so that each thread operates on a
contiguous chunk of data, in case they get assigned to separate
processors with their own caches.

However, I would go for simplicity, within the at-least-dual requirement.

Patrica
 
Reply With Quote
 
Chris Uppal
Guest
Posts: n/a
 
      11-14-2006
Arne Vajhøj wrote:

> No it is single core.
>
> BUT it has hyperthreading.
>
> Which in WinXP task manager looks like 2 CPU's !
>
> And to utilize HT you still need to multithread.


But don't assume that making the application use the other "cpu" will
necessarily speed anything up. HT is (for most purposes) better regarded as a
cheap marketing gimmick than a valid technology.

Or -- to put it another way -- the CPU usage reported by TaskManager is
misleading. It suggests that 50% of your available horse-power is
unused. My bet would be that it's more like 5% -- if not actually zero.

-- chris



 
Reply With Quote
 
 
 
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
increase in cpu usage on locking and locking the system sowmya.rangineni@gmail.com Computer Support 0 06-15-2007 12:06 PM
Increase CPU cycles and RAM usage google@joriz.is-a-geek.net Computer Information 3 09-16-2005 10:04 PM
Increase CPU cycles and RAM usage google@joriz.is-a-geek.net Computer Information 1 09-14-2005 02:18 AM
How to increase switch cpu load? zanzan Cisco 10 09-20-2004 02:46 PM
Looking for a way to increase CPU usage A. Lewenberg Perl Misc 5 02-21-2004 08:55 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57