kudu-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [kudu] branch master updated: [util] Fix the bug of MaybeGCAfterRelease()
Date Tue, 17 Sep 2019 20:44:10 GMT
This is an automated email from the ASF dual-hosted git repository.

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


The following commit(s) were added to refs/heads/master by this push:
     new ff8ee5d  [util] Fix the bug of MaybeGCAfterRelease()
ff8ee5d is described below

commit ff8ee5de8e0ba48456a132464e57e0feb49e8815
Author: lingbin <lingbinlb@gmail.com>
AuthorDate: Tue Sep 17 16:47:03 2019 +0800

    [util] Fix the bug of MaybeGCAfterRelease()
    
    The released_bytes parameter here must be a positive number,
    so when it is added to g_released_memory_since_gc, it
    should not be negative
    
    Change-Id: Ied1520a88ec58d27e9aa75c1c70f035d46f8b583
    Reviewed-on: http://gerrit.cloudera.org:8080/14244
    Reviewed-by: Yingchun Lai <405403881@qq.com>
    Reviewed-by: Adar Dembo <adar@cloudera.com>
    Tested-by: Adar Dembo <adar@cloudera.com>
---
 src/kudu/util/process_memory.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/kudu/util/process_memory.cc b/src/kudu/util/process_memory.cc
index d2f3653..6f932ff 100644
--- a/src/kudu/util/process_memory.cc
+++ b/src/kudu/util/process_memory.cc
@@ -275,7 +275,7 @@ bool SoftLimitExceeded(double* current_capacity_pct) {
 void MaybeGCAfterRelease(int64_t released_bytes) {
 #ifdef TCMALLOC_ENABLED
   int64_t now_released = base::subtle::NoBarrier_AtomicIncrement(
-      &g_released_memory_since_gc, -released_bytes);
+      &g_released_memory_since_gc, released_bytes);
   if (PREDICT_FALSE(now_released > kGcReleaseSize)) {
     base::subtle::NoBarrier_Store(&g_released_memory_since_gc, 0);
     GcTcmalloc();


Mime
View raw message