LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
art::MemoryAdjuster Class Reference

Public Types

using Parameters = ServiceTable< Config >
 

Public Member Functions

 MemoryAdjuster (ServiceTable< Config > const &config[[gnu::unused]])
 

Detailed Description

Definition at line 31 of file MemoryAdjuster_service.cc.

Member Typedef Documentation

Definition at line 33 of file MemoryAdjuster_service.cc.

Constructor & Destructor Documentation

art::MemoryAdjuster::MemoryAdjuster ( ServiceTable< Config > const &config]  [[gnu::unused])
inline

Definition at line 34 of file MemoryAdjuster_service.cc.

References DECLARE_ART_SERVICE, DEFINE_ART_SERVICE, art::getGlobalOptionSetter(), and art::LEGACY.

35  {
36 #ifndef __linux__
37  mf::LogAbsolute("MemoryAdjuster")
38  << "\n"
39  << "Service not supported for this operating system.\n"
40  << "If desired, please log an issue with:\n\n"
41  << "https://cdcvs.fnal.gov/redmine/projects/cet-is/issues/new\n\n";
42 #else
43  auto& mopts = art::getGlobalOptionSetter();
44  auto const p_mmap_max = config().m_mmap_max();
45  auto const p_trim_thr = config().m_trim_thr();
46  auto const p_top_pad = config().m_top_pad();
47  auto const p_mmap_thr = config().m_mmap_thr();
48  if (p_mmap_max >= 0) {
49  mopts.set_mmap_max(p_mmap_max);
50  }
51  if (p_trim_thr >= 0) {
52  mopts.set_trim_thr(p_trim_thr);
53  }
54  if (p_top_pad >= 0) {
55  mopts.set_top_pad(p_top_pad);
56  }
57  if (p_mmap_thr >= 0) {
58  mopts.set_mmap_thr(p_mmap_thr);
59  }
60  mopts.adjustMallocParams();
61 
62  if (mopts.hasErrors()) {
63  mf::LogWarning("MemoryCheck")
64  << "ERROR: Problem with setting malloc options\n"
65  << mopts.error_message();
66  }
67  if (config().dump()) {
68  mf::LogWarning("MemoryCheck")
69  << "Malloc options: " << mopts.get() << "\n";
70  }
71 #endif
72  } // c'tor
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
MallocOptionSetter & getGlobalOptionSetter()
Definition: MallocOpts.cc:207
MaybeLogger_< ELseverityLevel::ELsev_severe, true > LogAbsolute

The documentation for this class was generated from the following file: