-
Notifications
You must be signed in to change notification settings - Fork 62
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
Memory leak in StFstClusterMaker #590
Labels
bug
Something isn't working
Comments
Hi @genevb Thanks for all of your work on this and on narrowing down this issue. We will discuss this in the FWD software meeting today and try to find a solution asap |
If it's of any help, I placed my log file from the 500 event test I ran yesterday here on SDCC: |
plexoos
added a commit
that referenced
this issue
Oct 6, 2023
Memory leaks were found by Gene in issue #590. There are 3 places causing the leak in `StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx`: 1. Pointers assigned to std::vector in `line 55` were not deleted before calling std::vector::pop_back() in `line 69` and `line 80`. 2. Object created in `line 140` but only conditionally assigned to a std::vector in `line 148`. 3. In `line 203`, std::vector::erase() was called without deleting the pointers. After fixing these places, there is no memory leak from StFstClusterMaker reported by valgrind. --------- Co-authored-by: Dmitri Smirnov <[email protected]> Co-authored-by: Te-Chuan Huang <[email protected]>
resolved by #593 |
dkapukchyan
pushed a commit
to dkapukchyan/star-sw
that referenced
this issue
Mar 11, 2024
Memory leaks were found by Gene in issue star-bnl#590. There are 3 places causing the leak in `StFstClusterMaker/StFstScanRadiusClusterAlgo.cxx`: 1. Pointers assigned to std::vector in `line 55` were not deleted before calling std::vector::pop_back() in `line 69` and `line 80`. 2. Object created in `line 140` but only conditionally assigned to a std::vector in `line 148`. 3. In `line 203`, std::vector::erase() was called without deleting the pointers. After fixing these places, there is no memory leak from StFstClusterMaker reported by valgrind. --------- Co-authored-by: Dmitri Smirnov <[email protected]> Co-authored-by: Te-Chuan Huang <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Processing 500 Run 22 pp500 events in valgrind without TPC, just the FWD detector makers, I get 2 definite memory leaks and 2 possible memory leaks, shown below.
Here is the chain I ran. This took ~1 hour outside valgrind and ~2 hours inside valgrind. Fewer events would probably be fine to show the problems if you want to run it faster.
Thanks
-Gene
==26363== 2,621,528 bytes in 46,813 blocks are definitely lost in loss record 278,294 of 278,315
==26363== at 0x76AD203: operator new(unsigned long) (vg_replace_malloc.c:334)
==26363== by 0x7E01968: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:325)
==26363== by 0x297D875C: operator new (TObject.h:156)
==26363== by 0x297D875C: StFstScanRadiusClusterAlgo::doClustering(StFstCollection const&, StFstRawHitCollection&, StFstClusterCollection&) (StFstScanRadiusClusterAlgo.cxx:55)
==26363== by 0x297D840F: StFstIClusterAlgo::doClustering(StFstCollection&) (StFstIClusterAlgo.cxx:25)
==26363== by 0x297D7AF3: StFstClusterMaker::Make() (StFstClusterMaker.cxx:59)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F0E4E7: StChain::EventLoop(int, int, StMaker*) (StChain.cxx:206)
==26363== by 0x14F28988: G__StChain_Cint_552_0_9(G__value*, char const*, G__param*, int) (in /afs/rhic.bnl.gov/star/packages/release32/gitdev/.sl73_x8664_gcc485/OBJ/StRoot/StChain/StChain.so)
==26363== by 0x83B44DC: Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int) (Api.cxx:393)
==26363== by 0x82BCF26: G__execute_call (newlink.cxx:2408)
==26363== by 0x82BD2E4: G__call_cppfunc (newlink.cxx:2612)
...and...
==26363== 1,513,008 bytes in 21,014 blocks are definitely lost in loss record 278,281 of 278,315
==26363== at 0x76AD203: operator new(unsigned long) (vg_replace_malloc.c:334)
==26363== by 0x7E01968: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:325)
==26363== by 0x297D8B81: operator new (TObject.h:156)
==26363== by 0x297D8B81: StFstScanRadiusClusterAlgo::doClustering(StFstCollection const&, StFstRawHitCollection&, StFstClusterCollection&) (StFstScanRadiusClusterAlgo.cxx:140)
==26363== by 0x297D840F: StFstIClusterAlgo::doClustering(StFstCollection&) (StFstIClusterAlgo.cxx:25)
==26363== by 0x297D7AF3: StFstClusterMaker::Make() (StFstClusterMaker.cxx:59)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F0E4E7: StChain::EventLoop(int, int, StMaker*) (StChain.cxx:206)
==26363== by 0x14F28988: G__StChain_Cint_552_0_9(G__value*, char const*, G__param*, int) (in /afs/rhic.bnl.gov/star/packages/release32/gitdev/.sl73_x8664_gcc485/OBJ/StRoot/StChain/StChain.so)
==26363== by 0x83B44DC: Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int) (Api.cxx:393)
==26363== by 0x82BCF26: G__execute_call (newlink.cxx:2408)
==26363== by 0x82BD2E4: G__call_cppfunc (newlink.cxx:2612)
...and...
==26363== 724,864 bytes in 12,944 blocks are possibly lost in loss record 278,256 of 278,315
==26363== at 0x76AD203: operator new(unsigned long) (vg_replace_malloc.c:334)
==26363== by 0x7E01968: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:325)
==26363== by 0x297D875C: operator new (TObject.h:156)
==26363== by 0x297D875C: StFstScanRadiusClusterAlgo::doClustering(StFstCollection const&, StFstRawHitCollection&, StFstClusterCollection&) (StFstScanRadiusClusterAlgo.cxx:55)
==26363== by 0x297D840F: StFstIClusterAlgo::doClustering(StFstCollection&) (StFstIClusterAlgo.cxx:25)
==26363== by 0x297D7AF3: StFstClusterMaker::Make() (StFstClusterMaker.cxx:59)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F0E4E7: StChain::EventLoop(int, int, StMaker*) (StChain.cxx:206)
==26363== by 0x14F28988: G__StChain_Cint_552_0_9(G__value*, char const*, G__param*, int) (in /afs/rhic.bnl.gov/star/packages/release32/gitdev/.sl73_x8664_gcc485/OBJ/StRoot/StChain/StChain.so)
==26363== by 0x83B44DC: Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int) (Api.cxx:393)
==26363== by 0x82BCF26: G__execute_call (newlink.cxx:2408)
==26363== by 0x82BD2E4: G__call_cppfunc (newlink.cxx:2612)
...and...
==26363== 615,384 bytes in 8,547 blocks are possibly lost in loss record 278,249 of 278,315
==26363== at 0x76AD203: operator new(unsigned long) (vg_replace_malloc.c:334)
==26363== by 0x7E01968: TStorage::ObjectAlloc(unsigned long) (TStorage.cxx:325)
==26363== by 0x297D8B81: operator new (TObject.h:156)
==26363== by 0x297D8B81: StFstScanRadiusClusterAlgo::doClustering(StFstCollection const&, StFstRawHitCollection&, StFstClusterCollection&) (StFstScanRadiusClusterAlgo.cxx:140)
==26363== by 0x297D840F: StFstIClusterAlgo::doClustering(StFstCollection&) (StFstIClusterAlgo.cxx:25)
==26363== by 0x297D7AF3: StFstClusterMaker::Make() (StFstClusterMaker.cxx:59)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F1309E: StMaker::Make() (StMaker.cxx:937)
==26363== by 0x14F0E4E7: StChain::EventLoop(int, int, StMaker*) (StChain.cxx:206)
==26363== by 0x14F28988: G__StChain_Cint_552_0_9(G__value*, char const*, G__param*, int) (in /afs/rhic.bnl.gov/star/packages/release32/gitdev/.sl73_x8664_gcc485/OBJ/StRoot/StChain/StChain.so)
==26363== by 0x83B44DC: Cint::G__ExceptionWrapper(int ()(G__value, char const*, G__param*, int), G__value*, char*, G__param*, int) (Api.cxx:393)
==26363== by 0x82BCF26: G__execute_call (newlink.cxx:2408)
==26363== by 0x82BD2E4: G__call_cppfunc (newlink.cxx:2612)
The text was updated successfully, but these errors were encountered: