diff --git a/FWCore/Services/plugins/SimpleMemoryCheck.cc b/FWCore/Services/plugins/SimpleMemoryCheck.cc index 42dfc02f47ad2..5fedb057cd5f6 100644 --- a/FWCore/Services/plugins/SimpleMemoryCheck.cc +++ b/FWCore/Services/plugins/SimpleMemoryCheck.cc @@ -123,6 +123,7 @@ namespace edm { //options bool showMallocInfo_; bool oncePerEventMode_; + bool printEachTime_; bool jobReportOutputOnly_; bool monitorPssAndPrivate_; std::atomic count_; @@ -338,6 +339,7 @@ namespace edm { num_to_skip_(iPS.getUntrackedParameter("ignoreTotal")), showMallocInfo_(iPS.getUntrackedParameter("showMallocInfo")), oncePerEventMode_(iPS.getUntrackedParameter("oncePerEventMode")), + printEachTime_(oncePerEventMode_ or iPS.getUntrackedParameter("printEachSample")), jobReportOutputOnly_(iPS.getUntrackedParameter("jobReportOutputOnly")), monitorPssAndPrivate_(iPS.getUntrackedParameter("monitorPssAndPrivate")), count_(), @@ -422,6 +424,8 @@ namespace edm { ->setComment( "Use a special thread to sample memory at the set rate. A value of 0 means no sampling. This option " "cannot be used with 'oncePerEventMode' or 'moduleMemorySummary'."); + desc.addUntracked("printEachSample", false) + ->setComment("If sampling on, print each sample taken else will print only when sample is the largest seen."); desc.addUntracked("showMallocInfo", false); desc.addUntracked("oncePerEventMode", false) ->setComment( @@ -897,7 +901,7 @@ namespace edm { void SimpleMemoryCheck::andPrint(std::string const& type, std::string const& mdlabel, std::string const& mdname) const { - if (not jobReportOutputOnly_ && ((*current_ > max_) || oncePerEventMode_)) { + if (not jobReportOutputOnly_ && ((*current_ > max_) || printEachTime_)) { if (count_ >= num_to_skip_) { double deltaVSIZE = current_->vsize - max_.vsize; double deltaRSS = current_->rss - max_.rss;