star-fst-l AT lists.bnl.gov
Subject: Star-fst-l mailing list
List archive
- From: Te-Chuan Huang <tchuang AT rcf.rhic.bnl.gov>
- To: videbaek <videbaek AT bnl.gov>
- Cc: Star-fst L <star-fst-l AT lists.bnl.gov>
- Subject: Re: [Star-fst-l] FstClusterMaker
- Date: Sun, 1 Oct 2023 10:20:46 -0500
Hi Flemming,
Thanks for the catch.
I also had a look at the codes.
Actually, I found a few more places that the pointers created with “new” were assigned to std::vector but were not deleted before calling pop_back() or erase().
I think I have identified all the memory leak by running 20 events in valgrind.
I’m now running 500 events to confirm.
Once it passes the 500 events test, I will make a pull request for this.
Cheers,
Te-Chuan
On Oct 1, 2023, at 9:53 AM, videbaek <videbaek AT bnl.gov> wrote:
Hi
I took a brief look at the code in FstClustermaker and found somecode that could cause a
memory leak.
The newcluster object is only added conditionally to the clustervec,
and thus is not deleted if this condition is not full filled.
The statement if(nToSeedHit>0)
could be moved up ahead of creating the newCluster objectline 137 + in StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx
totCharge = tempSumCharge;
totChargeErr = sqrt(tempSumChargeErrSquare / nToMerge);
newCluster = new StFstCluster((int)wedge * 10000 + clusterLabel, disk, wedge, sensor, apv, meanRStrip, meanPhiStrip, totCharge, totChargeErr, clusterType);
newCluster->setNRawHits(clusterSize);
newCluster->setNRawHitsR(clusterSizeR);
newCluster->setNRawHitsPhi(clusterSizePhi);
newCluster->setMaxTimeBin(maxTb);
newCluster->setIdTruth(idTruth);
if(nToSeedhit>0) {
clustersVec[sensorIdx][phiIdx].push_back(newCluster);
clusterLabel++;
}
--
Flemming Videbaek
senior scientist, emeritus
videbaek @ bnl.gov
Brookhaven National Lab
Physics Department
Bldg 510D
Upton, NY 11973
phone: 631-344-4106
cell : 631-681-1596
_______________________________________________
Star-fst-l mailing list
Star-fst-l AT lists.bnl.gov
https://lists.bnl.gov/mailman/listinfo/star-fst-l
-
[Star-fst-l] FstClusterMaker,
videbaek, 10/01/2023
- Re: [Star-fst-l] FstClusterMaker, Te-Chuan Huang, 10/01/2023
-
Re: [Star-fst-l] FstClusterMaker,
Te-Chuan Huang, 10/01/2023
-
Re: [Star-fst-l] FstClusterMaker,
Brandenburg, Daniel, 10/01/2023
- Re: [Star-fst-l] FstClusterMaker, Te-Chuan Huang, 10/01/2023
-
Re: [Star-fst-l] FstClusterMaker,
Brandenburg, Daniel, 10/01/2023
Archive powered by MHonArc 2.6.24.