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

morningman pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 2074b83c67 [enhancement](third-party) Upgrade JEMalloc version from 
5.2.1 to 5.3.0 (#14871)
2074b83c67 is described below

commit 2074b83c67a7d6015e032942da955dd57c42feb1
Author: Xinyi Zou <[email protected]>
AuthorDate: Mon Feb 20 00:00:40 2023 +0800

    [enhancement](third-party) Upgrade JEMalloc version from 5.2.1 to 5.3.0 
(#14871)
    
    https://github.com/jemalloc/jemalloc/releases
---
 be/src/http/default_path_handlers.cpp   |  2 +-
 be/src/runtime/memory/jemalloc_hook.cpp | 48 ++++++++++++++++-----------------
 be/src/util/mem_info.cpp                |  2 +-
 be/src/util/mem_info.h                  |  2 +-
 4 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/be/src/http/default_path_handlers.cpp 
b/be/src/http/default_path_handlers.cpp
index e0ddfbbb37..aab581012d 100644
--- a/be/src/http/default_path_handlers.cpp
+++ b/be/src/http/default_path_handlers.cpp
@@ -103,7 +103,7 @@ void mem_usage_handler(const WebPageHandler::ArgumentMap& 
args, std::stringstrea
         auto* _opaque = static_cast<std::string*>(opaque);
         _opaque->append(buf);
     };
-    je_malloc_stats_print(write_cb, &tmp, "a");
+    jemalloc_stats_print(write_cb, &tmp, "a");
     boost::replace_all(tmp, "\n", "<br>");
     (*output) << tmp << "</pre>";
 #else
diff --git a/be/src/runtime/memory/jemalloc_hook.cpp 
b/be/src/runtime/memory/jemalloc_hook.cpp
index 1558776331..82b546b885 100644
--- a/be/src/runtime/memory/jemalloc_hook.cpp
+++ b/be/src/runtime/memory/jemalloc_hook.cpp
@@ -31,17 +31,17 @@ void* doris_malloc(size_t size) __THROW {
     // Both je_nallocx and je_malloc will use the lock 
je_malloc_mutex_lock_slow,
     // so enabling the jemalloc hook will double the lock usage.
     // In extreme cases this will affect performance, consider turning off mem 
hook
-    TRY_CONSUME_MEM_TRACKER(je_nallocx(size, 0), nullptr);
-    void* ptr = je_malloc(size);
+    TRY_CONSUME_MEM_TRACKER(jenallocx(size, 0), nullptr);
+    void* ptr = jemalloc(size);
     if (UNLIKELY(ptr == nullptr)) {
-        RELEASE_MEM_TRACKER(je_nallocx(size, 0));
+        RELEASE_MEM_TRACKER(jenallocx(size, 0));
     }
     return ptr;
 }
 
 void doris_free(void* p) __THROW {
-    RELEASE_MEM_TRACKER(je_malloc_usable_size(p));
-    je_free(p);
+    RELEASE_MEM_TRACKER(jemalloc_usable_size(p));
+    jefree(p);
 }
 
 void* doris_realloc(void* p, size_t size) __THROW {
@@ -50,13 +50,13 @@ void* doris_realloc(void* p, size_t size) __THROW {
     }
 
 #if USE_MEM_TRACKER
-    int64_t old_size = je_malloc_usable_size(p);
+    int64_t old_size = jemalloc_usable_size(p);
 #endif
 
-    TRY_CONSUME_MEM_TRACKER(je_nallocx(size, 0) - old_size, nullptr);
-    void* ptr = je_realloc(p, size);
+    TRY_CONSUME_MEM_TRACKER(jenallocx(size, 0) - old_size, nullptr);
+    void* ptr = jerealloc(p, size);
     if (UNLIKELY(ptr == nullptr)) {
-        RELEASE_MEM_TRACKER(je_nallocx(size, 0) - old_size);
+        RELEASE_MEM_TRACKER(jenallocx(size, 0) - old_size);
     }
     return ptr;
 }
@@ -67,77 +67,77 @@ void* doris_calloc(size_t n, size_t size) __THROW {
     }
 
     TRY_CONSUME_MEM_TRACKER(n * size, nullptr);
-    void* ptr = je_calloc(n, size);
+    void* ptr = jecalloc(n, size);
     if (UNLIKELY(ptr == nullptr)) {
         RELEASE_MEM_TRACKER(n * size);
     } else {
-        CONSUME_MEM_TRACKER(je_malloc_usable_size(ptr) - n * size);
+        CONSUME_MEM_TRACKER(jemalloc_usable_size(ptr) - n * size);
     }
     return ptr;
 }
 
 void doris_cfree(void* ptr) __THROW {
-    RELEASE_MEM_TRACKER(je_malloc_usable_size(ptr));
-    je_free(ptr);
+    RELEASE_MEM_TRACKER(jemalloc_usable_size(ptr));
+    jefree(ptr);
 }
 
 void* doris_memalign(size_t align, size_t size) __THROW {
     TRY_CONSUME_MEM_TRACKER(size, nullptr);
-    void* ptr = je_aligned_alloc(align, size);
+    void* ptr = jealigned_alloc(align, size);
     if (UNLIKELY(ptr == nullptr)) {
         RELEASE_MEM_TRACKER(size);
     } else {
-        CONSUME_MEM_TRACKER(je_malloc_usable_size(ptr) - size);
+        CONSUME_MEM_TRACKER(jemalloc_usable_size(ptr) - size);
     }
     return ptr;
 }
 
 void* doris_aligned_alloc(size_t align, size_t size) __THROW {
     TRY_CONSUME_MEM_TRACKER(size, nullptr);
-    void* ptr = je_aligned_alloc(align, size);
+    void* ptr = jealigned_alloc(align, size);
     if (UNLIKELY(ptr == nullptr)) {
         RELEASE_MEM_TRACKER(size);
     } else {
-        CONSUME_MEM_TRACKER(je_malloc_usable_size(ptr) - size);
+        CONSUME_MEM_TRACKER(jemalloc_usable_size(ptr) - size);
     }
     return ptr;
 }
 
 void* doris_valloc(size_t size) __THROW {
     TRY_CONSUME_MEM_TRACKER(size, nullptr);
-    void* ptr = je_valloc(size);
+    void* ptr = jevalloc(size);
     if (UNLIKELY(ptr == nullptr)) {
         RELEASE_MEM_TRACKER(size);
     } else {
-        CONSUME_MEM_TRACKER(je_malloc_usable_size(ptr) - size);
+        CONSUME_MEM_TRACKER(jemalloc_usable_size(ptr) - size);
     }
     return ptr;
 }
 
 void* doris_pvalloc(size_t size) __THROW {
     TRY_CONSUME_MEM_TRACKER(size, nullptr);
-    void* ptr = je_valloc(size);
+    void* ptr = jevalloc(size);
     if (UNLIKELY(ptr == nullptr)) {
         RELEASE_MEM_TRACKER(size);
     } else {
-        CONSUME_MEM_TRACKER(je_malloc_usable_size(ptr) - size);
+        CONSUME_MEM_TRACKER(jemalloc_usable_size(ptr) - size);
     }
     return ptr;
 }
 
 int doris_posix_memalign(void** r, size_t align, size_t size) __THROW {
     TRY_CONSUME_MEM_TRACKER(size, ENOMEM);
-    int ret = je_posix_memalign(r, align, size);
+    int ret = jeposix_memalign(r, align, size);
     if (UNLIKELY(ret != 0)) {
         RELEASE_MEM_TRACKER(size);
     } else {
-        CONSUME_MEM_TRACKER(je_malloc_usable_size(*r) - size);
+        CONSUME_MEM_TRACKER(jemalloc_usable_size(*r) - size);
     }
     return ret;
 }
 
 size_t doris_malloc_usable_size(void* ptr) __THROW {
-    size_t ret = je_malloc_usable_size(ptr);
+    size_t ret = jemalloc_usable_size(ptr);
     return ret;
 }
 
diff --git a/be/src/util/mem_info.cpp b/be/src/util/mem_info.cpp
index b7e68674e8..4ba9883eaa 100644
--- a/be/src/util/mem_info.cpp
+++ b/be/src/util/mem_info.cpp
@@ -69,7 +69,7 @@ void MemInfo::refresh_allocator_mem() {
 #elif defined(USE_JEMALLOC)
     uint64_t epoch = 0;
     size_t sz = sizeof(epoch);
-    je_mallctl("epoch", &epoch, &sz, &epoch, sz);
+    jemallctl("epoch", &epoch, &sz, &epoch, sz);
 
     // https://jemalloc.net/jemalloc.3.html
     _s_allocator_cache_mem =
diff --git a/be/src/util/mem_info.h b/be/src/util/mem_info.h
index 2cb17eb6b8..b13368222a 100644
--- a/be/src/util/mem_info.h
+++ b/be/src/util/mem_info.h
@@ -76,7 +76,7 @@ public:
 #ifdef USE_JEMALLOC
         size_t value = 0;
         size_t sz = sizeof(value);
-        if (je_mallctl(name.c_str(), &value, &sz, nullptr, 0) == 0) {
+        if (jemallctl(name.c_str(), &value, &sz, nullptr, 0) == 0) {
             return value;
         }
 #endif


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to