New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[10.0.x] remove memory leak in PVValidation and fix ini file #21428
Conversation
The code-checks are being triggered in jenkins. |
+code-checks |
A new Pull Request was created by @mmusich (Marco Musich) for master. It involves the following packages: Alignment/OfflineValidation @ghellwig, @arunhep, @cerminar, @cmsbuild, @franzoni, @lpernie can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
please test |
The tests are being triggered in jenkins. |
@mmusich sorry, I overlooked the example ini file |
@ghellwig, no problem, I don't mind (as long as it works out of the box :) ) |
why cloning in first place? |
@VinInn, admittedly no good reason - just bad copy paste of other code from my side... fixing |
The code-checks are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
Comparison is ready There are some workflows for which there are errors in the baseline: Comparison Summary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @davidlange6, @slava77, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
@@ -186,6 +186,8 @@ PrimaryVertexValidation::~PrimaryVertexValidation() | |||
{ | |||
// do anything here that needs to be done at desctruction time | |||
// (e.g. close files, deallocate resources etc.) | |||
if (theTrackFilter_) delete theTrackFilter_; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference, it would be much better to change theTrackFilter_
and theTrackClusterizer_
to be std::unique_ptr
rather than doing explicit deletes. Also, there is no need to test for nullptr
before calling delete
since, internally, delete
does the same check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @Dr15Jones, thanks for the comment. I'll keep that in mind for the next iteration.
As I got inspiration from,
cmssw/RecoVertex/PrimaryVertexProducer/src/PrimaryVertexProducerAlgorithm.cc
Lines 106 to 107 in efba733
if (theTrackFilter) delete theTrackFilter; | |
if (theTrackClusterizer) delete theTrackClusterizer; |
I think same comment applies also there: maybe worth opening an issue?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed
The purpose of this PR is to remove the large memory leak introduced in c3db41b.
As the cloned recHit was not destroyed after being used, running over a large sample of data was resulting in jobs killed because of memory exhaustion.
For comparison here is the RSS performance measured by running over 10k events of run 305967 of
/HLTPhysics/Run2017F-TkAlMinBias-PromptReco-v1/ALCARECO
I profit of this PR also to clean-up two other (relatively minor) memory leaks as well as to change the nomenclature in the example ini file, which is now broken due to fb07740.