[Dune] memory loss with matrix operator in dune-disc

Chamakuri Nagaiah Nagaiah.Chamakuri at Student.Uni-Magdeburg.DE
Tue Jun 24 16:14:31 CEST 2008


Dear Markus,
here is the output with those options...

==21803==
==21803== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 8 from 1)
==21803== malloc/free: in use at exit: 37,344 bytes in 8 blocks.
==21803== malloc/free: 4,580 allocs, 4,572 frees, 6,789,818 bytes allocated.
==21803== For counts of detected errors, rerun with: -v
==21803== searching for pointers to 8 not-freed blocks.
==21803== checked 599,304 bytes.
==21803==
==21803== 892 bytes in 1 blocks are definitely lost in loss record 1 of 6
==21803==    at 0x4022F34: operator new[](unsigned) (vg_replace_malloc.c:268)
==21803==    by 0x8058B6F: Dune::BCRSMatrix<Dune::FieldMatrix<double,  
1, 1>, Dune::ISTLAllocator>::allocate(int, int, int, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x81F5333: Dune::P1MGTransfer<Dune::ALUSimplexGrid<3,  
3>, double, 1>::P1MGTransfer(Dune::ALUSimplexGrid<3, 3> const&, int)  
(in /home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x8216F1C:  
Dune::SeqP1GeomMG<Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator>, Dune::ALUSimplexGrid<3, 3>,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>,  
1>::SeqP1GeomMG(Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator> const&, Dune::ALUSimplexGrid<3, 3> const&,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>&, int, int, int, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821C7A3: void testadaptivity<Dune::ALUSimplexGrid<3,  
3> >(Dune::ALUSimplexGrid<3, 3>&, int, int, bool, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821EB14: GridTester<3>::alugrid_simplex_test() (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x804D132: main (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==
==21803==
==21803== 1,784 bytes in 1 blocks are definitely lost in loss record 2 of 6
==21803==    at 0x4022F34: operator new[](unsigned) (vg_replace_malloc.c:268)
==21803==    by 0x8058B5E: Dune::BCRSMatrix<Dune::FieldMatrix<double,  
1, 1>, Dune::ISTLAllocator>::allocate(int, int, int, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x81F5333: Dune::P1MGTransfer<Dune::ALUSimplexGrid<3,  
3>, double, 1>::P1MGTransfer(Dune::ALUSimplexGrid<3, 3> const&, int)  
(in /home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x8216F1C:  
Dune::SeqP1GeomMG<Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator>, Dune::ALUSimplexGrid<3, 3>,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>,  
1>::SeqP1GeomMG(Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator> const&, Dune::ALUSimplexGrid<3, 3> const&,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>&, int, int, int, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821C7A3: void testadaptivity<Dune::ALUSimplexGrid<3,  
3> >(Dune::ALUSimplexGrid<3, 3>&, int, int, bool, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821EB14: GridTester<3>::alugrid_simplex_test() (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x804D132: main (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==
==21803==
==21803== 5,332 bytes in 1 blocks are definitely lost in loss record 3 of 6
==21803==    at 0x4022F34: operator new[](unsigned) (vg_replace_malloc.c:268)
==21803==    by 0x821A99D: Dune::P1OperatorBase<Dune::LeafTag,  
Dune::ALUSimplexGrid<3, 3>, double, Dune::IndexSet<Dune::ALU3dGrid<3,  
3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLeafIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLeafIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > >,  
Dune::LeafCommunicate<Dune::ALUSimplexGrid<3, 3> >,  
1>::P1OperatorBase(Dune::ALUSimplexGrid<3, 3> const&,  
Dune::IndexSet<Dune::ALU3dGrid<3, 3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLeafIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLeafIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > > const&,  
Dune::LeafCommunicate<Dune::ALUSimplexGrid<3, 3> >, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821C5B9: void testadaptivity<Dune::ALUSimplexGrid<3,  
3> >(Dune::ALUSimplexGrid<3, 3>&, int, int, bool, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821EB14: GridTester<3>::alugrid_simplex_test() (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x804D132: main (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==
==21803==
==21803== 6,224 bytes in 2 blocks are definitely lost in loss record 4 of 6
==21803==    at 0x4022F34: operator new[](unsigned) (vg_replace_malloc.c:268)
==21803==    by 0x821560E: Dune::P1OperatorBase<Dune::LevelTag,  
Dune::ALUSimplexGrid<3, 3>, double, Dune::IndexSet<Dune::ALU3dGrid<3,  
3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLevelIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLevelIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > >,  
Dune::LevelCommunicate<Dune::ALUSimplexGrid<3, 3> >,  
1>::P1OperatorBase(Dune::ALUSimplexGrid<3, 3> const&,  
Dune::IndexSet<Dune::ALU3dGrid<3, 3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLevelIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLevelIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > > const&,  
Dune::LevelCommunicate<Dune::ALUSimplexGrid<3, 3> >, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x8216E82:  
Dune::SeqP1GeomMG<Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator>, Dune::ALUSimplexGrid<3, 3>,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>,  
1>::SeqP1GeomMG(Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator> const&, Dune::ALUSimplexGrid<3, 3> const&,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>&, int, int, int, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821C7A3: void testadaptivity<Dune::ALUSimplexGrid<3,  
3> >(Dune::ALUSimplexGrid<3, 3>&, int, int, bool, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821EB14: GridTester<3>::alugrid_simplex_test() (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x804D132: main (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==
==21803==
==21803== 10,664 bytes in 1 blocks are definitely lost in loss record 5 of 6
==21803==    at 0x4022F34: operator new[](unsigned) (vg_replace_malloc.c:268)
==21803==    by 0x821A983: Dune::P1OperatorBase<Dune::LeafTag,  
Dune::ALUSimplexGrid<3, 3>, double, Dune::IndexSet<Dune::ALU3dGrid<3,  
3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLeafIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLeafIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > >,  
Dune::LeafCommunicate<Dune::ALUSimplexGrid<3, 3> >,  
1>::P1OperatorBase(Dune::ALUSimplexGrid<3, 3> const&,  
Dune::IndexSet<Dune::ALU3dGrid<3, 3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLeafIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLeafIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > > const&,  
Dune::LeafCommunicate<Dune::ALUSimplexGrid<3, 3> >, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821C5B9: void testadaptivity<Dune::ALUSimplexGrid<3,  
3> >(Dune::ALUSimplexGrid<3, 3>&, int, int, bool, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821EB14: GridTester<3>::alugrid_simplex_test() (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x804D132: main (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==
==21803==
==21803== 12,448 bytes in 2 blocks are definitely lost in loss record 6 of 6
==21803==    at 0x4022F34: operator new[](unsigned) (vg_replace_malloc.c:268)
==21803==    by 0x82155F4: Dune::P1OperatorBase<Dune::LevelTag,  
Dune::ALUSimplexGrid<3, 3>, double, Dune::IndexSet<Dune::ALU3dGrid<3,  
3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLevelIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLevelIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > >,  
Dune::LevelCommunicate<Dune::ALUSimplexGrid<3, 3> >,  
1>::P1OperatorBase(Dune::ALUSimplexGrid<3, 3> const&,  
Dune::IndexSet<Dune::ALU3dGrid<3, 3, (Dune::ALU3dGridElementType)4>,  
Dune::DefaultLevelIndexSet<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> >,  
Dune::DefaultLevelIteratorTypes<Dune::ALU3dGrid<3, 3,  
(Dune::ALU3dGridElementType)4> > > const&,  
Dune::LevelCommunicate<Dune::ALUSimplexGrid<3, 3> >, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x8216E82:  
Dune::SeqP1GeomMG<Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator>, Dune::ALUSimplexGrid<3, 3>,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>, Dune::BlockVector<Dune::FieldVector<double, 1>,  
Dune::ISTLAllocator>,  
1>::SeqP1GeomMG(Dune::BCRSMatrix<Dune::FieldMatrix<double, 1, 1>,  
Dune::ISTLAllocator> const&, Dune::ALUSimplexGrid<3, 3> const&,  
Dune::GroundwaterEquationLocalStiffness<Dune::ALUSimplexGrid<3, 3>,  
double>&, int, int, int, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821C7A3: void testadaptivity<Dune::ALUSimplexGrid<3,  
3> >(Dune::ALUSimplexGrid<3, 3>&, int, int, bool, bool) (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x821EB14: GridTester<3>::alugrid_simplex_test() (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==    by 0x804D132: main (in  
/home/chamakur/Dune/dune-home/dune-user/calcium/testcases/testad)
==21803==
==21803== LEAK SUMMARY:
==21803==    definitely lost: 37,344 bytes in 8 blocks.
==21803==      possibly lost: 0 bytes in 0 blocks.
==21803==    still reachable: 0 bytes in 0 blocks.
==21803==         suppressed: 0 bytes in 0 blocks.



Regards
Nagaiah




Quoting Markus Blatt <Markus.Blatt at ipvs.uni-stuttgart.de>:

> Hi,
>
> On Tue, Jun 24, 2008 at 03:38:38PM +0200, Chamakuri Nagaiah wrote:
>
>> I realized that there is a memory loss problem in the matrix operator.
>> For example I have tested the testadaptivity.cc problem in dune-dd
>> using valgrind debugger and copied the debugging summary .
>> I ran the simulation with different number of iterations as following...
>>
>> 1) ./valgrind-3.3.0/bin/valgrind ./testadapt alusimplex 1 local
>> nopicture 0.0025 0.1
>> summary for the valgrind :
>> ==21340==    definitely lost: 37,344 bytes in 8 blocks.
>> ==21340==      possibly lost: 0 bytes in 0 blocks.
>> ==21340==    still reachable: 0 bytes in 0 blocks.
>> ==21340==         suppressed: 0 bytes in 0 blocks.
>>
>> 2) ./valgrind-3.3.0/bin/valgrind ./testadapt alusimplex 2 local
>> nopicture 0.0025 0.1
>> summary :
>> ==21461==    definitely lost: 132,264 bytes in 20 blocks.
>> ==21461==      possibly lost: 0 bytes in 0 blocks.
>> ==21461==    still reachable: 0 bytes in 0 blocks.
>> ==21461==         suppressed: 0 bytes in 0 blocks.
>>
>>
>>
>> 3) ./valgrind-3.3.0/bin/valgrind ./testadapt alusimplex 3 local
>> nopicture 0.0025 0.1
>>
>> summary :
>> ==21674==    definitely lost: 303,888 bytes in 32 blocks.
>> ==21674==      possibly lost: 0 bytes in 0 blocks.
>> ==21674==    still reachable: 0 bytes in 0 blocks.
>> ==21674==         suppressed: 0 bytes in 0 blocks.
>>
>>
>>
>> 4) ./valgrind-3.3.0/bin/valgrind ./testadapt alusimplex 4 local
>> nopicture 0.0025 0.1
>> summary :
>> ==21678==    definitely lost: 563,280 bytes in 44 blocks.
>> ==21678==      possibly lost: 0 bytes in 0 blocks.
>> ==21678==    still reachable: 0 bytes in 0 blocks.
>> ==21678==         suppressed: 0 bytes in 0 blocks.
>>
>>
>> if I increase the number of iterations, then memory lost increases
>> subsequently.
>>
>
> Judging from the output you posted I cannot comprehend why this leak is ought
> to be in the matrix operator.
>
>
>> I tried to figure it out but did not succeed. I would appreciate
>> your response.
>>
>
> Try
>
> man valgrind
>
> to find out which options have to be provided for more detailed
> information.
>
> Hint: --leak-check=yes --show-reachable=yes
>
> Cheers,
>
> Markus
>
> _______________________________________________
> Dune mailing list
> Dune at dune-project.org
> http://lists.dune-project.org/mailman/listinfo/dune
>






More information about the Dune mailing list