Changes between Initial Version and Version 1 of Ticket #24660


Ignore:
Timestamp:
02/05/18 10:57:09 (4 years ago)
Author:
Konrad127123
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #24660

    • Property Keywords memory leak SubgraphSearch added
    • Property Component changed from PLEASE CHANGE to memleak
    • Property Type changed from PLEASE CHANGE to defect
    • Property Authors changed from to Konrad K. Dabrowski
  • Ticket #24660 – Description

    initial v1  
     1In SubgraphSearch in generic_graph_pyx.pyx
     2
     3__cinit__ contains the line:
     4self.tmp_array  = <int *>  sig_malloc(self.ng * sizeof(int))
     5
     6but __dealloc__ is missing the line:
     7sig_free(self.tmp_array)
     8
     9This leads to a memory leak, which can be demonstrated with:
     10
     11{{{
     12g=graphs.PathGraph(4)
     13f=graphs.CycleGraph(4)
     14for i in xrange(1,1000000):
     15    g.subgraph_search(f,induced=True)
     16    if i%10000==0:
     17        print(sage.misc.getusage.linux_memory_usage())
     18}}}
     19
     20Without the missing line, the memory usage keeps increasing (about 32 bytes per iteration). With the line added, the memory usage is constant.