igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] igraph_read_graph_gml memory leak?


From: Mile Sikic
Subject: [igraph] igraph_read_graph_gml memory leak?
Date: Fri, 18 Mar 2011 09:52:22 +0100

Dear sirs

I am analyzing memory allocation by Valgrind. 

When I use gml input parser i get the following output

-------------------------------------------
HEAP SUMMARY:
==3800==     in use at exit: 16,458 bytes in 3 blocks
==3800==   total heap usage: 228,595 allocs, 228,592 frees, 7,470,226 bytes allocated
==3800== 
==3800== 8 bytes in 1 blocks are still reachable in loss record 1 of 3
==3800==    at 0x4C274A8: malloc (vg_replace_malloc.c:236)
==3800==    by 0x4EB9A4F: igraph_gml_yyensure_buffer_stack (foreign-gml-lexer.c:1528)
==3800==    by 0x4EBA72A: igraph_gml_yylex (foreign-gml-lexer.c:765)
==3800==    by 0x4EB93C1: igraph_gml_yyparse (foreign-gml-parser.c:1368)
==3800==    by 0x4EA8EC3: igraph_read_graph_gml (foreign.c:1095)
==3800==    by 0x41026B: init_infected_structure(input*, SIMULATION, infected*) (epidemic.cpp:1023)
==3800==    by 0x40D348: run_simulation(int, char**, SIMULATION) (epidemic.cpp:41)
==3800==    by 0x416161: main (main.cpp:48)
==3800== 
==3800== 64 bytes in 1 blocks are still reachable in loss record 2 of 3
==3800==    at 0x4C274A8: malloc (vg_replace_malloc.c:236)
==3800==    by 0x4EB9ED2: igraph_gml_yy_create_buffer (foreign-gml-lexer.c:1364)
==3800==    by 0x4EBA749: igraph_gml_yylex (foreign-gml-lexer.c:767)
==3800==    by 0x4EB93C1: igraph_gml_yyparse (foreign-gml-parser.c:1368)
==3800==    by 0x4EA8EC3: igraph_read_graph_gml (foreign.c:1095)
==3800==    by 0x41026B: init_infected_structure(input*, SIMULATION, infected*) (epidemic.cpp:1023)
==3800==    by 0x40D348: run_simulation(int, char**, SIMULATION) (epidemic.cpp:41)
==3800==    by 0x416161: main (main.cpp:48)
==3800== 
==3800== 16,386 bytes in 1 blocks are still reachable in loss record 3 of 3
==3800==    at 0x4C274A8: malloc (vg_replace_malloc.c:236)
==3800==    by 0x4EB9EEB: igraph_gml_yy_create_buffer (foreign-gml-lexer.c:1373)
==3800==    by 0x4EBA749: igraph_gml_yylex (foreign-gml-lexer.c:767)
==3800==    by 0x4EB93C1: igraph_gml_yyparse (foreign-gml-parser.c:1368)
==3800==    by 0x4EA8EC3: igraph_read_graph_gml (foreign.c:1095)
==3800==    by 0x41026B: init_infected_structure(input*, SIMULATION, infected*) (epidemic.cpp:1023)
==3800==    by 0x40D348: run_simulation(int, char**, SIMULATION) (epidemic.cpp:41)
==3800==    by 0x416161: main (main.cpp:48)
==3800== 
==3800== LEAK SUMMARY:
==3800==    definitely lost: 0 bytes in 0 blocks
==3800==    indirectly lost: 0 bytes in 0 blocks
==3800==      possibly lost: 0 bytes in 0 blocks
==3800==    still reachable: 16,458 bytes in 3 blocks
==3800==         suppressed: 0 bytes in 0 blocks
----------------------------------------------------------------------------------------------------------------------------

If I use edgelist format i get

----------------------------------------------------------------------------------------------------------------------------
 HEAP SUMMARY:
==3996==     in use at exit: 0 bytes in 0 blocks
==3996==   total heap usage: 21,527 allocs, 21,527 frees, 3,161,957 bytes allocated
==3996== 
==3996== All heap blocks were freed -- no leaks are possible
-------------------------------------------------------------------------------------------------------------------------------

I believe the reason for that is a memory leak in gml parser

Regards

Mile SIkic
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]