You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by ag...@apache.org on 2017/05/22 17:44:33 UTC

[10/15] ignite git commit: ignite-gg-12163 IGNITE_PDS_WAL_RECORD_ITERATOR_BUFFER_SIZE for avoid OOM

ignite-gg-12163 IGNITE_PDS_WAL_RECORD_ITERATOR_BUFFER_SIZE for avoid OOM


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/f3bb4740
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/f3bb4740
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/f3bb4740

Branch: refs/heads/ignite-5267
Commit: f3bb4740c3da5a32df03fd8ef2f08ace6ed9ffdc
Parents: f41c4fb
Author: Dmitriy Govorukhin <dm...@gmail.com>
Authored: Mon May 22 15:46:41 2017 +0300
Committer: Dmitriy Govorukhin <dm...@gmail.com>
Committed: Mon May 22 15:46:41 2017 +0300

----------------------------------------------------------------------
 .../cache/database/wal/FileWriteAheadLogManager.java    | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/f3bb4740/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/wal/FileWriteAheadLogManager.java
----------------------------------------------------------------------
diff --git a/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/wal/FileWriteAheadLogManager.java b/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/wal/FileWriteAheadLogManager.java
index 30b56d7..1ef9384 100644
--- a/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/wal/FileWriteAheadLogManager.java
+++ b/modules/pds/src/main/java/org/apache/ignite/internal/processors/cache/database/wal/FileWriteAheadLogManager.java
@@ -109,6 +109,9 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
     /** */
     public static final String IGNITE_PDS_WAL_FSYNC_DELAY = "IGNITE_PDS_WAL_FSYNC_DELAY"; // TODO may be move to config
 
+    /** Ignite pds wal record iterator buffer size. */
+    public static final String IGNITE_PDS_WAL_RECORD_ITERATOR_BUFFER_SIZE = "IGNITE_PDS_WAL_RECORD_ITERATOR_BUFFER_SIZE";
+
     /** */
     public static final String IGNITE_PDS_WAL_ALWAYS_WRITE_FULL_PAGES = "IGNITE_PDS_WAL_ALWAYS_WRITE_FULL_PAGES";
 
@@ -1933,6 +1936,10 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
         /** */
         private static final long serialVersionUID = 0L;
 
+        /** Buffer size. */
+        private final int buffSize = IgniteSystemProperties.getInteger(
+            IGNITE_PDS_WAL_RECORD_ITERATOR_BUFFER_SIZE, 64 * 1024 * 1024);
+
         /** */
         private final File walWorkDir;
 
@@ -2005,8 +2012,11 @@ public class FileWriteAheadLogManager extends GridCacheSharedManagerAdapter impl
             this.end = end;
             this.log = log;
 
+            int tlbSize0 = 16 * tlbSize;
+            int buffSize0 = tlbSize0 < buffSize ? tlbSize0 : buffSize;
+
             // Do not allocate direct buffer for iterator.
-            buf = ByteBuffer.allocate(16 * tlbSize);
+            buf = ByteBuffer.allocate(buffSize0);
             buf.order(ByteOrder.nativeOrder());
 
             init();