Skip to content

#556 GenericReferenceElements leak memory

Metadata

Property Value
Reported by Oliver Sander (oliver.sander@tu-dresden.de)
Reported at Jun 4, 2009 13:10
Type Bug Report
Version Git (pre2.4) [autotools]
Operating System Unspecified / All
Last edited by Martin Nolte (nolte@mathematik.uni-freiburg.de)
Last edited at Apr 14, 2010 05:14
Closed by Martin Nolte (nolte@mathematik.uni-freiburg.de)
Closed at Apr 14, 2010 05:14
Closed in version Unknown
Resolution Fixed
Comment

Description

The GenericReferenceElement seems to leak memory. You can witness this when running the OneDGrid test under valgrind. Here's what you get:

sander@haile:/export/local-1/daten/users/sander/dune/dune-grid/grid/test$ valgrind --leak-check=full ./test-oned
==7333== Memcheck, a memory error detector.
==7333== Copyright (C) 2002-2008, and GNU GPL'd, by Julian Seward et al.
==7333== Using LibVEX rev 1884, a library for dynamic binary translation.
==7333== Copyright (C) 2004-2008, and GNU GPL'd, by OpenWorks LLP.
==7333== Using valgrind-3.4.1-Debian, a dynamic binary instrumentation framework.
==7333== Copyright (C) 2000-2008, and GNU GPL'd, by Julian Seward et al.
==7333== For more details, rerun with: -v
==7333==
==7333==
==7333== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 17 from 1)
==7333== malloc/free: in use at exit: 68 bytes in 1 blocks.
==7333== malloc/free: 10,939 allocs, 10,938 frees, 1,080,876 bytes allocated. ==7333== For counts of detected errors, rerun with: -v ==7333== searching for pointers to 1 not-freed blocks. ==7333== checked 395,180 bytes. ==7333== ==7333== 68 bytes in 1 blocks are definitely lost in loss record 1 of 1 ==7333== at 0x402534E: operator new[](unsigned int) (vg_replace_malloc.c:268) ==7333== by 0x80838C5: Dune::SmallObjectPool::allocate(unsigned int) (smallobject.hh:71) ==7333== by 0x80838EF: Dune::SmallObject::operator new(unsigned int) (smallobject.hh:98) ==7333== by 0x808395C: void Dune::GenericReferenceElement<double, 0>::initialize<(Dune::GeometryType::BasicType)0>() (genericreferenceelements.hh:272) ==7333== by 0x80839E1: Dune::GenericReferenceElementContainer<double, 0>::GenericReferenceElementContainer() (genericreferenceelements.hh:615) ==7333== by 0x8083A48: Dune::GenericReferenceElementContainer<double, 0>::instance() (genericreferenceelements.hh:608) ==7333== by 0x8083AC9: Dune::GenericReferenceElements<double, 0>::general(Dune::GeometryType const&) (genericreferenceelements.hh:632) ==7333== by 0x8083B15: void checkGeometry<Dune::Geometry<0, 1, Dune::OneDGrid const, Dune::OneDGridGeometry> >(Dune::Geometry<0, 1, Dune::OneDGrid const, Dune::OneDGridGeometry> const&) (checkintersectionit.cc:39) ==7333== by 0x8085AA3: void checkIntersectionIterator<Dune::GridView<Dune::DefaultLevelGridViewTraits<Dune::OneDGrid const, (Dune::PartitionIteratorType)4> >, CheckIntersectionIteratorErrorState>(Dune::GridView<Dune::DefaultLevelGridViewTraits<Dune::OneDGrid const, (Dune::PartitionIteratorType)4> > const&, Dune::GridView<Dune::DefaultLevelGridViewTraits<Dune::OneDGrid const, (Dune::PartitionIteratorType)4> >::Codim::Iterator const&, CheckIntersectionIteratorErrorState&) (checkintersectionit.cc:305) ==7333== by 0x8086FCD: void checkViewIntersectionIterator<Dune::GridView<Dune::DefaultLevelGridViewTraits<Dune::OneDGrid const, (Dune::PartitionIteratorType)4> > >(Dune::GridView<Dune::DefaultLevelGridViewTraits<Dune::OneDGrid const, (Dune::PartitionIteratorType)4> > const&) (checkintersectionit.cc:462) ==7333== by 0x8089B96: void checkIntersectionIteratorDune::OneDGrid(Dune::OneDGrid const&, bool) (checkintersectionit.cc:486) ==7333== by 0x804947B: testOneDGrid(Dune::OneDGrid&) (test-oned.cc:55) ==7333== ==7333== LEAK SUMMARY: ==7333== definitely lost: 68 bytes in 1 blocks. ==7333== possibly lost: 0 bytes in 0 blocks. ==7333== still reachable: 0 bytes in 0 blocks. ==7333== suppressed: 0 bytes in 0 blocks.