sphenix-tracking-l AT lists.bnl.gov
Subject: sPHENIX tracking discussion
List archive
Re: [Sphenix-tracking-l] [EXTERNAL] Re: memory plots for 10k events
- From: "Osborn, Joe" <osbornjd AT ornl.gov>
- To: Hugo Pereira Da Costa <hugo.pereira-da-costa AT cea.fr>, Anthony Frawley <afrawley AT fsu.edu>, "sphenix-tracking-l AT lists.bnl.gov" <sphenix-tracking-l AT lists.bnl.gov>
- Subject: Re: [Sphenix-tracking-l] [EXTERNAL] Re: memory plots for 10k events
- Date: Fri, 14 Jan 2022 18:10:25 +0000
Hi Hugo,
This begs the question of what is the circumstance when two clusters with the same key are created? Why does this happen? I can try to see if I can reproduce this behavior…
Joe
---------------------------
Joe Osborn, Ph.D. Associate Research Scientist Oak Ridge National Laboratory osbornjd AT ornl.gov (859)-433-8738
From:
sPHENIX-tracking-l <sphenix-tracking-l-bounces AT lists.bnl.gov> on behalf of Hugo Pereira Da Costa via sPHENIX-tracking-l <sphenix-tracking-l AT lists.bnl.gov>
On 1/14/22 10:40, Anthony Frawley wrote:
Hi Tony,
Sorry for the confusion: - the part that might lead to a leak is not "if(my_data.clusterlist)" (clusterlist = nullptr never happens, and if it were, clus.release would not be called and the unique_ptr would delete the cluster properly)
- The part that might lead to a leak is: my_data.clusterlist->insert(std::make_pair(ckey, clus.release()));
The way maps work, is that if ckey is already in the map, the pair in _not_ inserted. however, clus.release() is still called, and thus the unique_ptr does not delete the cluster even though it is not inserted in the map. Is this more clear ?
What we should do, is
- check that the insertion really happen (this can be done by checking the output of ::insert, namely: if( !my_data.clusterlist->insert(...).second ) { do_something; }, as documented here: https://en.cppreference.com/w/cpp/container/map/insert - complain if this is not the case (because to my understanding this should not happen), and delete the cluster nonetheless. This might need a bit of logic change (because once you have called clus.release you cannot access the cluster pointed to by the unique_ptr any more.
I can provide a patch.
Hugo
|
-
[Sphenix-tracking-l] memory plots for 10k events,
pinkenburg, 01/14/2022
- Re: [Sphenix-tracking-l] [EXTERNAL] memory plots for 10k events, Osborn, Joe, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Anthony Frawley, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
pinkenburg, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Hugo Pereira Da Costa, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Anthony Frawley, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Hugo Pereira Da Costa, 01/14/2022
-
Re: [Sphenix-tracking-l] [EXTERNAL] Re: memory plots for 10k events,
Osborn, Joe, 01/14/2022
- Re: [Sphenix-tracking-l] [EXTERNAL] Re: memory plots for 10k events, Hugo Pereira Da Costa, 01/14/2022
-
Re: [Sphenix-tracking-l] [EXTERNAL] Re: memory plots for 10k events,
Osborn, Joe, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Hugo Pereira Da Costa, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Anthony Frawley, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Hugo Pereira Da Costa, 01/14/2022
- Re: [Sphenix-tracking-l] memory plots for 10k events, pinkenburg, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
Hugo Pereira Da Costa, 01/14/2022
-
Re: [Sphenix-tracking-l] memory plots for 10k events,
pinkenburg, 01/14/2022
Archive powered by MHonArc 2.6.24.