You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/03/10 07:23:56 UTC
[35/43] ignite git commit: IGNITE-4694 Add tests to check there are
no memory leaks in PageMemory
IGNITE-4694 Add tests to check there are no memory leaks in PageMemory
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/27178f13
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/27178f13
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/27178f13
Branch: refs/heads/ignite-4712
Commit: 27178f1394efed5a0e72e4a66d19bd2c9d1bb5c1
Parents: af05cd8
Author: Igor Seliverstov <gv...@gmail.com>
Authored: Wed Feb 22 13:18:18 2017 +0300
Committer: Igor Seliverstov <gv...@gmail.com>
Committed: Wed Mar 1 10:44:55 2017 +0300
----------------------------------------------------------------------
.../IgniteDbMemoryLeakAbstractTest.java | 22 +++++++++-----------
1 file changed, 10 insertions(+), 12 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/27178f13/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
----------------------------------------------------------------------
diff --git a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
index aa32495..04ac5ea 100644
--- a/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
+++ b/modules/core/src/test/java/org/apache/ignite/internal/processors/database/IgniteDbMemoryLeakAbstractTest.java
@@ -75,7 +75,7 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
@Override protected void configure(MemoryConfiguration mCfg) {
mCfg.setConcurrencyLevel(CONCURRENCY_LEVEL);
- long size = 1024 * pagesMax() * (isLargePage() ? 16 : 1);
+ long size = (1024 * (isLargePage() ? 16 : 1) + 24) * pagesMax();
mCfg.setPageCacheSize(Math.max(size, MIN_PAGE_CACHE_SIZE));
}
@@ -92,7 +92,7 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
*/
@SuppressWarnings("WeakerAccess")
protected int warmUp() {
- return 300;
+ return 450;
}
/** {@inheritDoc} */
@@ -172,6 +172,8 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
final IgniteEx ignite = grid(0);
final IgniteCache<Object, Object> cache = cache(ignite);
+
+
Runnable target = new Runnable() {
@Override public void run() {
while (ex == null && System.nanoTime() < endTime) {
@@ -196,11 +198,15 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
threads[i].start();
}
- Thread.sleep(TimeUnit.NANOSECONDS.toMillis(warmUpEndTime - System.nanoTime()));
+ while (ex == null && System.nanoTime() < warmUpEndTime)
+ Thread.sleep(100);
+
+ if (ex != null)
+ throw ex;
info("Warming up is ended.");
- while (System.nanoTime() < endTime) {
+ while (ex == null && System.nanoTime() < endTime) {
try {
check(ignite);
}
@@ -213,9 +219,6 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
Thread.sleep(TimeUnit.SECONDS.toMillis(5));
}
- for (Thread thread : threads)
- thread.join();
-
if (ex != null)
throw ex;
}
@@ -228,11 +231,6 @@ public abstract class IgniteDbMemoryLeakAbstractTest extends IgniteDbAbstractTes
*/
protected void check(IgniteEx ig) throws Exception {
long pagesActual = ig.context().cache().context().database().pageMemory().loadedPages();
- long pagesMax = pagesMax();
-
- assertTrue(
- "Maximal allowed pages number is exceeded [allowed=" + pagesMax + ", actual= " + pagesActual + "]",
- pagesActual <= pagesMax);
if (loadedPages > 0) {
delta += pagesActual - loadedPages;