From 5890b559b2c13636e20eb29d43d2031286f6c1ed Mon Sep 17 00:00:00 2001
From: Alaettin Serhan Mete <alaettin.serhan.mete@cern.ch>
Date: Thu, 16 Sep 2021 17:19:51 +0200
Subject: [PATCH] Drop BDT tree caches to avoid unnecessary memory allocations

---
 Reconstruction/MVAUtils/Root/BDT.cxx | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Reconstruction/MVAUtils/Root/BDT.cxx b/Reconstruction/MVAUtils/Root/BDT.cxx
index 46ed101c7229..50cdfe10397f 100644
--- a/Reconstruction/MVAUtils/Root/BDT.cxx
+++ b/Reconstruction/MVAUtils/Root/BDT.cxx
@@ -58,6 +58,7 @@ BDT::BDT(::TTree *tree)
 {
   // at runtime decide which flavour of BDT we need to build
   // the information is coming from the title of the TTree
+  if (tree) tree->SetCacheSize(0); // Avoid unnecessary memory allocations
   std::map<std::string, std::string> options = parseOptions(tree->GetTitle());
   std::string creator = get_default_string_map(options, std::string("creator"));
   if (creator == "lgbm")
-- 
GitLab