You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2022/06/28 06:24:04 UTC

[GitHub] [doris] yiguolei commented on a diff in pull request #9581: [Enhancement] [Memory] [Vectorized] Stress test and optimize memory allocation

yiguolei commented on code in PR #9581:
URL: https://github.com/apache/doris/pull/9581#discussion_r908081200


##########
be/src/vec/common/allocator.h:
##########
@@ -101,12 +113,75 @@ template <bool clear_memory_, bool mmap_populate>
 class Allocator {
 public:
     /// Allocate memory range.
-    void* alloc(size_t size, size_t alignment = 0) { return alloc_no_track(size, alignment); }
+    void* alloc(size_t size, size_t alignment = 0) {
+        void* buf;
+
+        if (size >= MMAP_THRESHOLD) {
+            if (alignment > MMAP_MIN_ALIGNMENT)

Review Comment:
   Why not call populate to populate the memory to avoid too many page fault during usage?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org