In an effort to save processing time in the following project:
test_map_pointing.zip (28.3 KB)
I created the files “makeAntSphericalCosineProductsFiles.cxx” and “makeDeltaTMapFiles.cxx” to generate TFiles containing histograms to be referenced by functions in the source file “src/eventCorrelator.cc”. However, when I run the binary of the file “testMapPointing.cxx”, I see using the command “htop” that memory usage increases over time (memory leak). I figured that this was due to how I reference the TFiles, so in the functions referencing these TFiles I tried explicitly deleting pointers to the histograms at the end of these functions. I also tried Close() on these TFiles at the end of these functions. I see no difference in the memory usage after deleting the histograms. The binary “testMapPointing” also crashes when I tried adding Close() to the functions “fillMapsPair()” and “fillFlatMapsPair()”. The Close() command I have in the function “getTotalPowerMaps()” appears to not cause a crash, but it’s difficult to tell if there is an improvement since there still appears to be a memory leak.
Still thinking that the memory leak was due to the handling of these TFiles, I then changed from using (TFile) objects to (TFile *) pointers, and tried using the suggestions found here. The “testMapPointing” binary still crashed. So I reverted back to using (TFile) objects and commented out the lines in the functions “fillMapsPair()”, “fillFlatMapsPair()”, “getTotalPowerMaps()” inspired by the link above.
With how the three functions mentioned above are currently written in “src/eventCorrelator.cc”, does anyone notice an obvious memory leak source? I don’t think it has to do with usage of OpenMP, because this leak still happens when I set “export OMP_NUM_THREADS=1”.
I wish I could share more on the files necessary to run the attached project, but they are too huge to share here and I don’t have a cloud account at CERN to share them. What I do have is zshenv and zshrc files in the zipped archive which sets paths used in this project, as they depend on the projects which can be cloned from here.
ROOT Version: 6.18/00
Platform: Linux (CentOS Linux 7 (Core))
Compiler: gcc