Gerco
20-09-2008, 18:19
Hey people,
a few days ago, I encountered a strange performance issue in a Java program running on a Windows 2003 server. I managed to isolate the issue to the "get" method of HashMap.
public void run() {
HashMap map = new HashMap();
// Put a few values in the map
for(int i=0; i<10000000; i++) {
Object value = map.get("key");
}
}
This is running on a 16-cpu, 64 bit Windows 2003 Server in a 64 bit Java 5 JVM and gets 10 of the CPUs up to 100% usage when running 10 threads. When I run the exact same code (the same .class files in fact) in a 32 bit Java 5 JVM on the same machine, none of the CPUs show any noticable activity and running the sample takes dozens of times more time.
Does anyone know why this is? Running on just 2 CPUs doesn't seem to produce the same issue and I don't have access to anything with more than 4 CPUs to perform further analysis.
a few days ago, I encountered a strange performance issue in a Java program running on a Windows 2003 server. I managed to isolate the issue to the "get" method of HashMap.
public void run() {
HashMap map = new HashMap();
// Put a few values in the map
for(int i=0; i<10000000; i++) {
Object value = map.get("key");
}
}
This is running on a 16-cpu, 64 bit Windows 2003 Server in a 64 bit Java 5 JVM and gets 10 of the CPUs up to 100% usage when running 10 threads. When I run the exact same code (the same .class files in fact) in a 32 bit Java 5 JVM on the same machine, none of the CPUs show any noticable activity and running the sample takes dozens of times more time.
Does anyone know why this is? Running on just 2 CPUs doesn't seem to produce the same issue and I don't have access to anything with more than 4 CPUs to perform further analysis.