You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2015/03/04 08:58:06 UTC
[1/2] syncope git commit: Reduing the thread number to avoid
OutOfMemory errors on some platforms
Repository: syncope
Updated Branches:
refs/heads/1_2_X 312897e87 -> c6640c99c
refs/heads/master bb468d133 -> 350b3bd24
Reduing the thread number to avoid OutOfMemory errors on some platforms
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/c6640c99
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/c6640c99
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/c6640c99
Branch: refs/heads/1_2_X
Commit: c6640c99c2cc7d242ba5b7f279de2c967c8cce40
Parents: 312897e
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Mar 4 08:31:05 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Mar 4 08:31:05 2015 +0100
----------------------------------------------------------------------
.../test/java/org/apache/syncope/client/ConcurrencyTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/c6640c99/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java b/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
index c7228c3..8c599db 100644
--- a/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
+++ b/client/src/test/java/org/apache/syncope/client/ConcurrencyTest.java
@@ -30,6 +30,8 @@ public class ConcurrencyTest {
private static final Logger LOG = LoggerFactory.getLogger(ConcurrencyTest.class);
+ private static final int THREAD_NUMBER = 1000;
+
private static final SyncopeClient client =
new SyncopeClientFactoryBean().setAddress("http://url").create("username", "password");
@@ -37,7 +39,7 @@ public class ConcurrencyTest {
public void multiThreadTest()
throws InterruptedException {
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < THREAD_NUMBER; i++) {
Thread execution = new Thread("Th-" + StringUtils.leftPad(String.valueOf(i), 5, '0')) {
@Override
@@ -55,13 +57,13 @@ public class ConcurrencyTest {
execution.start();
}
- Thread.sleep(10000);
+ Thread.sleep(THREAD_NUMBER);
}
@Test
public void multiCallTest() {
try {
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < THREAD_NUMBER; i++) {
client.getService(ResourceService.class);
}
} catch (Exception e) {
[2/2] syncope git commit: Reduing the thread number to avoid
OutOfMemory errors on some platforms
Posted by il...@apache.org.
Reduing the thread number to avoid OutOfMemory errors on some platforms
Project: http://git-wip-us.apache.org/repos/asf/syncope/repo
Commit: http://git-wip-us.apache.org/repos/asf/syncope/commit/350b3bd2
Tree: http://git-wip-us.apache.org/repos/asf/syncope/tree/350b3bd2
Diff: http://git-wip-us.apache.org/repos/asf/syncope/diff/350b3bd2
Branch: refs/heads/master
Commit: 350b3bd2482decdaf696ee8b1ffdfaf045513bae
Parents: bb468d1
Author: Francesco Chicchiriccò <il...@apache.org>
Authored: Wed Mar 4 08:57:59 2015 +0100
Committer: Francesco Chicchiriccò <il...@apache.org>
Committed: Wed Mar 4 08:57:59 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/syncope/client/lib/ConcurrencyTest.java | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/syncope/blob/350b3bd2/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
----------------------------------------------------------------------
diff --git a/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java b/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
index 4657b2f..cbd7793 100644
--- a/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
+++ b/client/lib/src/test/java/org/apache/syncope/client/lib/ConcurrencyTest.java
@@ -30,6 +30,8 @@ public class ConcurrencyTest {
private static final Logger LOG = LoggerFactory.getLogger(ConcurrencyTest.class);
+ private static final int THREAD_NUMBER = 1000;
+
private static final SyncopeClient client =
new SyncopeClientFactoryBean().setAddress("http://url").create("username", "password");
@@ -37,7 +39,7 @@ public class ConcurrencyTest {
public void multiThreadTest()
throws InterruptedException {
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < THREAD_NUMBER; i++) {
Thread execution = new Thread("Th-" + StringUtils.leftPad(String.valueOf(i), 5, '0')) {
@Override
@@ -55,13 +57,13 @@ public class ConcurrencyTest {
execution.start();
}
- Thread.sleep(10000);
+ Thread.sleep(THREAD_NUMBER);
}
@Test
public void multiCallTest() {
try {
- for (int i = 0; i < 10000; i++) {
+ for (int i = 0; i < THREAD_NUMBER; i++) {
client.getService(ResourceService.class);
}
} catch (Exception e) {