Adar Dembo has posted comments on this change. ( 
http://gerrit.cloudera.org:8080/13606 )

Change subject: KUDU-2836: Release memory to OS periodically
......................................................................


Patch Set 1:

(7 comments)

http://gerrit.cloudera.org:8080/#/c/13606/1//COMMIT_MSG
Commit Message:

http://gerrit.cloudera.org:8080/#/c/13606/1//COMMIT_MSG@9
PS1, Line 9: resered
reserved


http://gerrit.cloudera.org:8080/#/c/13606/1//COMMIT_MSG@10
PS1, Line 10: operation
operating


http://gerrit.cloudera.org:8080/#/c/13606/1//COMMIT_MSG@11
PS1, Line 11: increased
increases


http://gerrit.cloudera.org:8080/#/c/13606/1//COMMIT_MSG@11
PS1, Line 11: used
fill


http://gerrit.cloudera.org:8080/#/c/13606/1//COMMIT_MSG@13
PS1, Line 13: This patch add a background thread to periodically GC tcmalloc
adds


http://gerrit.cloudera.org:8080/#/c/13606/1/src/kudu/server/server_base.cc
File src/kudu/server/server_base.cc:

http://gerrit.cloudera.org:8080/#/c/13606/1/src/kudu/server/server_base.cc@209
PS1, Line 209: 3600
How did you arrive at this default value?


http://gerrit.cloudera.org:8080/#/c/13606/1/src/kudu/server/server_base.cc@678
PS1, Line 678:   while (stop_background_threads_latch_.count() > 0) {
             :     MonoDelta gc_interval = 
MonoDelta::FromSeconds(FLAGS_gc_tcmalloc_memory_interval_seconds);
             :     if (gc_interval.Equals(MonoDelta::FromSeconds(0))) {
             :       // FLAGS_gc_tcmalloc_memory_interval_seconds is zero, that 
means Tcmalloc GC periodically
             :       // is disabled now. We can check this flag some time later.
             :       
stop_background_threads_latch_.WaitFor(MonoDelta::FromSeconds(60));
             :       continue;
             :     }
             :
             :     if (!stop_background_threads_latch_.WaitFor(gc_interval)) {
             :       kudu::process_memory::GcTcmalloc();
             :     }
             :   }
How about something like this:

  MonoDelta gc_interval;
  do {
    gc_interval = 
MonoDelta::FromSeconds(FLAGS_gc_tcmalloc_memory_interval_seconds > 0
      ? FLAGS_gc_tcmalloc_memory_interval_seconds : 60);
    if (FLAGS_gc_tcmalloc_memory_interval_seconds > 0) {
      kudu::process_memory::GcTcmalloc();
    }
  } while (!stop_background_threads_latch.WaitFor(gc_interval));



--
To view, visit http://gerrit.cloudera.org:8080/13606
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: kudu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ibeb3529ed53c250f69e5faf5b2a067b2abce06c0
Gerrit-Change-Number: 13606
Gerrit-PatchSet: 1
Gerrit-Owner: Yingchun Lai <405403...@qq.com>
Gerrit-Reviewer: Adar Dembo <a...@cloudera.com>
Gerrit-Reviewer: Kudu Jenkins (120)
Gerrit-Comment-Date: Thu, 13 Jun 2019 04:49:59 +0000
Gerrit-HasComments: Yes

Reply via email to