Antares_Simulator icon indicating copy to clipboard operation
Antares_Simulator copied to clipboard

Fix remaining memory leaks in simple-tests

Open flomnes opened this issue 2 years ago • 0 comments

See #669, #645

*** No errors detected
==180016== 
==180016== HEAP SUMMARY:
==180016==     in use at exit: 14,325,551 bytes in 1,484 blocks
==180016==   total heap usage: 415,668 allocs, 414,184 frees, 2,263,016,404 bytes allocated
==180016== 
==180016== 81,344 bytes in 1 blocks are possibly lost in loss record 133 of 168
==180016==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==180016==    by 0x48F71A9: LU_ChainageParColonneDeU (lu_reorganisation_chainages.c:244)
==180016==    by 0x48F312D: LU_FactorisationCalculs (lu_factorisation_calculs.c:458)
==180016==    by 0x48F1CC4: LU_Factorisation (lu_factorisation.c:155)
==180016==    by 0x48D4882: SPX_FactoriserLaBase (spx_factoriser_la_base.c:305)
==180016==    by 0x48DC05F: SPX_TestPassageBaseReduiteBaseComplete (spx_ordonner_contraintes_pour_la_base.c:125)
==180016==    by 0x48CEE86: SPX_DualSimplexe (spx_dual_simplexe.c:471)
==180016==    by 0x48E2EE1: SPX_SimplexeCalculs (spx_simplexe_calculs.c:303)
==180016==    by 0x48E2360: SPX_Simplexe (spx_simplexe.c:100)
==180016==    by 0x5F6525: OPT_AppelDuSimplexe(PROBLEME_HEBDO*, unsigned int, int) (opt_appel_solveur_lineaire.cpp:263)
==180016==    by 0x5EF13A: OPT_OptimisationLineaire(PROBLEME_HEBDO*, unsigned int) (opt_optimisation_lineaire.cpp:97)
==180016==    by 0x5E3047: OPT_PilotageOptimisationLineaire(PROBLEME_HEBDO*, unsigned int) (opt_pilotage_optimisation_lineaire.cpp:90)
==180016== 
==180016== 145,152 bytes in 9 blocks are definitely lost in loss record 155 of 168
==180016==    at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==180016==    by 0x2AF335: __gnu_cxx::new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::allocate(unsigned long, void const*) (new_allocator.h:114)
==180016==    by 0x2A0FF5: std::allocator_traits<std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::allocate(std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, unsigned long) (alloc_traits.h:444)
==180016==    by 0x28B7F1: std::_Vector_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_allocate(unsigned long) (stl_vector.h:343)
==180016==    by 0x5E40E3: std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_default_append(unsigned long) (vector.tcc:635)
==180016==    by 0x5E3F2E: std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::resize(unsigned long) (stl_vector.h:937)
==180016==    by 0x5E383C: optimisationAllocateProblem(PROBLEME_HEBDO*, int) (opt_alloc_probleme_a_optimiser.cpp:179)
==180016==    by 0x5E39EF: OPT_AllocDuProblemeAOptimiser(PROBLEME_HEBDO*) (opt_alloc_probleme_a_optimiser.cpp:197)
==180016==    by 0x5E2FCB: OPT_PilotageOptimisationLineaire(PROBLEME_HEBDO*, unsigned int) (opt_pilotage_optimisation_lineaire.cpp:67)
==180016==    by 0x5E2A2C: OPT_OptimisationHebdomadaire(PROBLEME_HEBDO*, unsigned int) (opt_optimisation_hebdo.cpp:52)
==180016==    by 0x5B82DD: Antares::Solver::Simulation::NoAdequacyPatchOptimization::solve(Antares::Solver::Variable::State&, int, unsigned int) (economy.cpp:109)
==180016==    by 0x5B8AD1: Antares::Solver::Simulation::Economy::year(Antares::Solver::Progression::Task&, Antares::Solver::Variable::State&, unsigned int, Antares::Solver::Simulation::yearRandomNumbers&, std::__cxx11::list<unsigned int, std::allocator<unsigned int> >&, bool) (economy.cpp:224)
==180016== 
==180016== 1,735,796 (86,016 direct, 1,649,780 indirect) bytes in 8 blocks are definitely lost in loss record 167 of 168
==180016==    at 0x483BE63: operator new(unsigned long) (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==180016==    by 0x2AF335: __gnu_cxx::new_allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >::allocate(unsigned long, void const*) (new_allocator.h:114)
==180016==    by 0x2A0FF5: std::allocator_traits<std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::allocate(std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >&, unsigned long) (alloc_traits.h:444)
==180016==    by 0x28B7F1: std::_Vector_base<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_allocate(unsigned long) (stl_vector.h:343)
==180016==    by 0x5E40E3: std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::_M_default_append(unsigned long) (vector.tcc:635)
==180016==    by 0x5E3F2E: std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >::resize(unsigned long) (stl_vector.h:937)
==180016==    by 0x5E385B: optimisationAllocateProblem(PROBLEME_HEBDO*, int) (opt_alloc_probleme_a_optimiser.cpp:180)
==180016==    by 0x5E39EF: OPT_AllocDuProblemeAOptimiser(PROBLEME_HEBDO*) (opt_alloc_probleme_a_optimiser.cpp:197)
==180016==    by 0x5E2FCB: OPT_PilotageOptimisationLineaire(PROBLEME_HEBDO*, unsigned int) (opt_pilotage_optimisation_lineaire.cpp:67)
==180016==    by 0x5E2A2C: OPT_OptimisationHebdomadaire(PROBLEME_HEBDO*, unsigned int) (opt_optimisation_hebdo.cpp:52)
==180016==    by 0x5B82DD: Antares::Solver::Simulation::NoAdequacyPatchOptimization::solve(Antares::Solver::Variable::State&, int, unsigned int) (economy.cpp:109)
==180016==    by 0x5B8AD1: Antares::Solver::Simulation::Economy::year(Antares::Solver::Progression::Task&, Antares::Solver::Variable::State&, unsigned int, Antares::Solver::Simulation::yearRandomNumbers&, std::__cxx11::list<unsigned int, std::allocator<unsigned int> >&, bool) (economy.cpp:224)
==180016== 
==180016== 12,349,904 (13,696 direct, 12,336,208 indirect) bytes in 8 blocks are definitely lost in loss record 168 of 168
==180016==    at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
==180016==    by 0x48E229B: SPX_Simplexe (spx_simplexe.c:65)
==180016==    by 0x5F6525: OPT_AppelDuSimplexe(PROBLEME_HEBDO*, unsigned int, int) (opt_appel_solveur_lineaire.cpp:263)
==180016==    by 0x5EF13A: OPT_OptimisationLineaire(PROBLEME_HEBDO*, unsigned int) (opt_optimisation_lineaire.cpp:97)
==180016==    by 0x5E3047: OPT_PilotageOptimisationLineaire(PROBLEME_HEBDO*, unsigned int) (opt_pilotage_optimisation_lineaire.cpp:90)
==180016==    by 0x5E2A2C: OPT_OptimisationHebdomadaire(PROBLEME_HEBDO*, unsigned int) (opt_optimisation_hebdo.cpp:52)
==180016==    by 0x5B82DD: Antares::Solver::Simulation::NoAdequacyPatchOptimization::solve(Antares::Solver::Variable::State&, int, unsigned int) (economy.cpp:109)
==180016==    by 0x5B8AD1: Antares::Solver::Simulation::Economy::year(Antares::Solver::Progression::Task&, Antares::Solver::Variable::State&, unsigned int, Antares::Solver::Simulation::yearRandomNumbers&, std::__cxx11::list<unsigned int, std::allocator<unsigned int> >&, bool) (economy.cpp:224)
==180016==    by 0x31EB35: Antares::Solver::Simulation::yearJob<Antares::Solver::Simulation::Economy>::onExecute() (solver.hxx:189)
==180016==    by 0x16D03F3: Yuni::Job::IJob::execute(Yuni::Thread::IThread*) (job.cpp:64)
==180016==    by 0x16DA7FC: void Yuni::Private::QueueService::JobAccessor<Yuni::Job::IJob>::Execute<Yuni::Private::QueueService::QueueThread>(Yuni::Job::IJob&, Yuni::Private::QueueService::QueueThread*) (fwd.h:41)
==180016==    by 0x16DA63B: Yuni::Private::QueueService::QueueThread::onExecute() (thread.cpp:34)
==180016== 
==180016== LEAK SUMMARY:
==180016==    definitely lost: 244,864 bytes in 25 blocks
==180016==    indirectly lost: 13,985,988 bytes in 1,252 blocks
==180016==      possibly lost: 81,344 bytes in 1 blocks
==180016==    still reachable: 13,355 bytes in 206 blocks
==180016==         suppressed: 0 bytes in 0 blocks
==180016== Reachable blocks (those to which a pointer was found) are not shown.
==180016== To see them, rerun with: --leak-check=full --show-leak-kinds=all

flomnes avatar Jan 10 '23 11:01 flomnes