JBoss 7.1.1.Final/JVM slows over time
lukascz Nov 19, 2012 10:53 AMI'm experiencing performance slow down on JBoss 7.1.1 Final. I wrote simple program that demostrates this behavior. I generate an array of 100,000 of random integers and run bubble sort on it.
@Model
public class PerformanceTest {
public void proceed() {
long now = System.currentTimeMillis();
int[] arr = new int[100000];
for(int i = 0; i < arr.length; i++) {
arr[i] = (int) (Math.random() * 200000);
}
long now2 = System.currentTimeMillis();
System.out.println((now2 - now) + "ms took to generate array");
now = System.currentTimeMillis();
bubbleSort(arr);
now2 = System.currentTimeMillis();
System.out.println((now2 - now) + "ms took to bubblesort array");
}
public void bubbleSort(int[] arr) {
boolean swapped = true;
int j = 0;
int tmp;
while (swapped) {
swapped = false;
j++;
for (int i = 0; i < arr.length - j; i++) {
if (arr[i] > arr[i + 1]) {
tmp = arr[i];
arr[i] = arr[i + 1];
arr[i + 1] = tmp;
swapped = true;
}
}
}
}
}
Just after I start the server, it takes approximately 22 seconds to run this code. After few days of JBoss 7.1.1. running, it takes 330 sec to run this code. In both cases, I launch the code when the CPU utilization is very low (say, 1%). Any ideas why? I run the server with following arguments:
-Xms1280m -Xmx2048m -XX:MaxPermSize=2048m -Djava.net.preferIPv4Stack=true -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true -Duser.timezone=UTC -Djboss.server.default.config=standalone-full.xml -Xrunjdwp:transport=dt_socket,address=8787,server=y,suspend=n
I'm running it on Linux machine with java version "1.7.0_07".