[MOAB-dev] memory leak

Iulian Grindeanu iulian at mcs.anl.gov
Tue Nov 5 15:10:19 CST 2013


----- Original Message -----

| Hello All,

| I add entity (meshset) to another meshset. This generate memory leak
| according to valgrind. Pleas see attached log.

| Should I manage meshsets using childs and parents, or adding meshset
| to another meshest using add_entities is accepted by moab.

using add_entities is accepted by moab; you can use "recursive" calls after that (recursive means it will scan the sets for other sets included) this is the meaning of 
recursive flag in get_entities type calls 

I will take a look, are you sure it is inside moab? 
How much is definitely "lost"? 

Thanks, 
Iulian 

| Kind regards,
| Lukasz

| ==35039== 8 bytes in 1 blocks are indirectly lost in loss record 796
| of 2,690
| ==35039== at 0x4C2B1C7: operator new(unsigned long) (in
| /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
| ==35039== by 0xAB14A1: __gnu_cxx::new_allocator<unsigned
| long>::allocate(unsigned long, void const*) (new_allocator.h:92)
| ==35039== by 0xCA82A8: std::_Vector_base<unsigned long,
| std::allocator<unsigned long> >::_M_allocate(unsigned long) (in
| /home/lukasz/tmp/mofem/build/atom_tests/arc_length_nonlinear_elasticity_atom)
| ==35039== by 0xD7080C: std::vector<unsigned long,
| std::allocator<unsigned long>
| >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned long*,
| std::vector<unsigned long, std::allocator<unsigned long> > >,
| unsigned long const&) (vector.tcc:327)
| ==35039== by 0xD6ED55: std::vector<unsigned long,
| std::allocator<unsigned long> >::push_back(unsigned long const&)
| (stl_vector.h:834)
| ==35039== by 0xF6D458: moab::AEntityFactory::add_adjacency(unsigned
| long, unsigned long, bool) (AEntityFactory.cpp:395)
| ==35039== by 0xD8B69F: moab::range_tool<std::pair<unsigned long,
| unsigned long>
| const*>::ranged_insert_entities(moab::MeshSet::Count&,
| moab::MeshSet::CompactList&, std::pair<unsigned long, unsigned long>
| const*, std::pair<unsigned long, unsigned long> const*, unsigned
| long, moab::AEntityFactory*) (MeshSet.cpp:610)
| ==35039== by 0xD8A6A3: moab::MeshSet::insert_entity_vector(unsigned
| long const*, unsigned long, unsigned long, moab::AEntityFactory*)
| (MeshSet.cpp:1111)
| ==35039== by 0xD6D215: moab::MeshSet::add_entities(unsigned long
| const*, int, unsigned long, moab::AEntityFactory*) (MeshSet.hpp:762)
| ==35039== by 0xD66249: moab::Core::add_entities(unsigned long,
| unsigned long const*, int) (Core.cpp:3224)
| ==35039== by 0xC0A148:
| MoFEM::FieldCore::add_ents_to_finite_element_by_MESHSET(unsigned
| long, std::string const&) (FieldCore.cpp:1404)
| ==35039== by 0xA75B7F: main
| (arc_length_nonlinear_elasticity_atom.cpp:177)
| ==35039==
| ==35039== 32 (24 direct, 8 indirect) bytes in 1 blocks are definitely
| lost in loss record 1,518 of 2,690
| ==35039== at 0x4C2B1C7: operator new(unsigned long) (in
| /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
| ==35039== by 0xF6DCCE: moab::AEntityFactory::get_adjacencies(unsigned
| long, std::vector<unsigned long, std::allocator<unsigned long> >*&,
| bool) (AEntityFactory.cpp:567)
| ==35039== by 0xF6D37B: moab::AEntityFactory::add_adjacency(unsigned
| long, unsigned long, bool) (AEntityFactory.cpp:378)
| ==35039== by 0xD8B69F: moab::range_tool<std::pair<unsigned long,
| unsigned long>
| const*>::ranged_insert_entities(moab::MeshSet::Count&,
| moab::MeshSet::CompactList&, std::pair<unsigned long, unsigned long>
| const*, std::pair<unsigned long, unsigned long> const*, unsigned
| long, moab::AEntityFactory*) (MeshSet.cpp:610)
| ==35039== by 0xD8A6A3: moab::MeshSet::insert_entity_vector(unsigned
| long const*, unsigned long, unsigned long, moab::AEntityFactory*)
| (MeshSet.cpp:1111)
| ==35039== by 0xD6D215: moab::MeshSet::add_entities(unsigned long
| const*, int, unsigned long, moab::AEntityFactory*) (MeshSet.hpp:762)
| ==35039== by 0xD66249: moab::Core::add_entities(unsigned long,
| unsigned long const*, int) (Core.cpp:3224)
| ==35039== by 0xC0A148:
| MoFEM::FieldCore::add_ents_to_finite_element_by_MESHSET(unsigned
| long, std::string const&) (FieldCore.cpp:1404)
| ==35039== by 0xA75B7F: main
| (arc_length_nonlinear_elasticity_atom.cpp:177)

| Full listing is here,

| http://cdash.eng.gla.ac.uk/cdash/viewDynamicAnalysisFile.php?id=181
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20131105/602dcc06/attachment.html>


More information about the moab-dev mailing list