Fix Memory Leak in LSPG ROM Builder and Solver by Ensuring Vector Zeroing#12342
Fix Memory Leak in LSPG ROM Builder and Solver by Ensuring Vector Zeroing#12342
Conversation
|
I'm relatively sure that the values within a floating point array are not the root cause of a memory leak. Have you tried running the leaky case with ASAN or Valgrind? |
You're right, it actually wasn't a memory leak. We found out that the issue was just improper initialization of the vector. We weren't setting the values to zero after resizing, which was causing the problems. We've fixed that now. |
|
@RiccardoRossi ready! |
|
Just to answer @matekelemen, We passed valgrind with leak check full and this was the only problem. I run it with ASAN some weeks ago and there was nothing reported. Of topic: Valgrind does report a problem while running with openmp with ~1K possible lost per OMP_THREAD, but has nothing to do with this test in particular |
Description
This PR resolves an issue with improper initialization found in the LSPG ROM builder and solver test (the bug was in the
global_rom_builder_and_solver.h). The problem was due to vectors not being zeroed out after resizing, leading to uninitialized floating point values, which could affect the accuracy and reliability of computations.