Author: rsvoboda(a)redhat.com
Date: 2010-06-15 07:42:30 -0400 (Tue, 15 Jun 2010)
New Revision: 12479
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/benchmark/Runner.java
Log:
Optimalization for threads:
- ThreadPool initialized only once pre test
- Finished threads were still in wait state, shutdown method on ExecutorService solves the
issue.
(problem only when running more tests at once, could end with
java.lang.OutOfMemoryError: unable to create new native thread)
Modified:
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/benchmark/Runner.java
===================================================================
---
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/benchmark/Runner.java 2010-06-15
11:29:21 UTC (rev 12478)
+++
framework/trunk/testsuite/test/java/org/jboss/test/ws/jaxws/benchmark/Runner.java 2010-06-15
11:42:30 UTC (rev 12479)
@@ -199,6 +199,7 @@
long total = 0;
long failed = 0;
long procTime = 0;
+ ExecutorService es = Executors.newFixedThreadPool(threadCount);
for (int run = 0; run < runs; run++)
{
System.out.println("*\n RUN " + run + "\n*");
@@ -210,7 +211,6 @@
DOMUtils.clearThreadLocals();
- ExecutorService es = Executors.newFixedThreadPool(threadCount);
long startProcTime = new Date().getTime();
List<Future<Result>> futures = es.invokeAll(callables);
long currentRunProcTime = new Date().getTime() - startProcTime;
@@ -249,6 +249,8 @@
System.out.println("------------------------------------");
System.out.println();
}
+ es.shutdown();
+
System.out.println("------------------------------------");
System.out.println("Iterations: " + total);
System.out.println("Failures: " + failed);
Show replies by date