You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by ro...@apache.org on 2021/08/18 02:40:42 UTC

[iotdb] branch arraypool-reduce-size created (now 85573e6)

This is an automated email from the ASF dual-hosted git repository.

rong pushed a change to branch arraypool-reduce-size
in repository https://gitbox.apache.org/repos/asf/iotdb.git.


      at 85573e6  PrimitiveArrayManager: make POOLED_ARRAYS_MEMORY_THRESHOLD smaller than its actual allowed value

This branch includes the following new commits:

     new 85573e6  PrimitiveArrayManager: make POOLED_ARRAYS_MEMORY_THRESHOLD smaller than its actual allowed value

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


[iotdb] 01/01: PrimitiveArrayManager: make POOLED_ARRAYS_MEMORY_THRESHOLD smaller than its actual allowed value

Posted by ro...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

rong pushed a commit to branch arraypool-reduce-size
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit 85573e6d6f200ddb3864f8975442f280efe3edfd
Author: Steve Yurong Su <ro...@apache.org>
AuthorDate: Fri Jul 16 17:32:58 2021 +0800

    PrimitiveArrayManager: make POOLED_ARRAYS_MEMORY_THRESHOLD smaller than its actual allowed value
---
 .../java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java b/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
index 0fd0524..e829c1b 100644
--- a/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
+++ b/server/src/main/java/org/apache/iotdb/db/rescon/PrimitiveArrayManager.java
@@ -40,9 +40,17 @@ public class PrimitiveArrayManager {
 
   public static final int ARRAY_SIZE = CONFIG.getPrimitiveArraySize();
 
+  /**
+   * The actual used memory will be 50% larger than the statistic, so we need to limit the size of
+   * POOLED_ARRAYS_MEMORY_THRESHOLD, make it smaller than its actual allowed value.
+   */
+  private static final double AMPLIFICATION_FACTOR = 1.5;
+
   /** threshold total size of arrays for all data types */
   private static final double POOLED_ARRAYS_MEMORY_THRESHOLD =
-      CONFIG.getAllocateMemoryForWrite() * CONFIG.getBufferedArraysMemoryProportion();
+      CONFIG.getAllocateMemoryForWrite()
+          * CONFIG.getBufferedArraysMemoryProportion()
+          / AMPLIFICATION_FACTOR;
 
   /** TSDataType#serialize() -> ArrayDeque<Array>, VECTOR is ignored */
   private static final ArrayDeque[] POOLED_ARRAYS = new ArrayDeque[TSDataType.values().length - 1];