Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Java Machine > JVM fails to us...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 704 of 843
Post > Topic >>

JVM fails to use more than one CPU/core on RH Linux?

by "Spuuf Cool" <spuufcool@[EMAIL PROTECTED] > Jul 24, 2006 at 12:44 PM

We're using the Sun 1.5.0_06 JVM on RedHat (AS). The box has 4 CPUs,
they're all available and get some load (i. e. OS recognized them and
they work). But al our JVM max out by just "digesting" a single CPU, i.
e. any JVM maxes out at 25% of the system load.

Using a simple CPU-eater program that runs multiple thread I was able
to:
- "digest" 2 cores on Win XP
- "digest" 2 cores on Max OS X (Intel)
- still only 1 (!) CU on the Linux server

Where's the problem? Anyone else having the same issue? There is just
one particularity to the Lunix installation, the Xeon CPUs are 64bit
but we're using the 32bit version of the OS (and JV; and all other
stuff).

Anyone seein the same problem.

For testing purposes this is the code I used (will digest up to 3 CPU
cores for max 30 secs.):

package test;

public class CpuBound {

	public static void main(String[] args) throws InterruptedException {
		Thread th1 = new Thread(new Eater());
		Thread th2 = new Thread(new Eater());
		Thread th3 = new Thread(new Eater());
		th1.start();
		th2.start();
		th3.start();
		int joinTime = 10*1000;
		System.out.println("Joining " + th1);
		th1.join(joinTime);
		System.out.println("Joining " + th2);
		th2.join(joinTime);
		System.out.println("Joining " + th3);
		th3.join(joinTime);
		System.out.println("End");
		System.exit(-1);
	}

	static class Eater implements Runnable {

		public void run() {
			Thread.yield();
			for( long l = Long.MIN_VALUE; l < Long.MAX_VALUE; l++) {
				long sprloink = l*l;
				if(sprloink > l) {
					sprloink = l;
				} else {
					sprloink-=l;
				}
			}
		}	
	}
}
 




 2 Posts in Topic:
JVM fails to use more than one CPU/core on RH Linux?
"Spuuf Cool" &l  2006-07-24 12:44:23 
Re: JVM fails to use more than one CPU/core on RH Linux?
"Chris Uppal" &  2006-07-25 09:26:04 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Dec 3 14:08:13 CST 2008.