igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Memory Leak - Automorphisms


From: Gábor Csárdi
Subject: Re: [igraph] Memory Leak - Automorphisms
Date: Wed, 1 Oct 2008 21:43:43 +0200

Kyle,

thanks for your report. There are two errors here, one is mine, the
other is yours, just for good measure. There is/was indeed a memory
leak in igraph_automorphisms(), I added

    delete g;

in function igraph_automorphisms() in file bliss.cc, just before the
'return 0;' line.

The other thing is, you need to free the group_size member of the info
structure, i.e. add

    free(info.group_size);

just before your 'igraph_destroy' line.

Unfortunately I cannot create a new Fedora package for you, we don't
make these, but maybe Neil (who does this) reads this email and wants
to create one. If not, then just install igraph from source, and make
the small correction above before compiling it.

Best,
Gabor

On Wed, Oct 1, 2008 at 8:33 PM, Kyle Bishop
<address@hidden> wrote:
> Hello,
>
> Could you please help me with the following problem? I need to compute the
> number of automorphisms of a series of (random) graphs; however, there seems
> to be a memory leak in the function igraph_automorphisms. The following
> c-code reproduces the problem - i.e., the memory used by the program
> increases without bound.
>
> I'm using the latest version of igraph as distributed by 'yum' on Fedora 9.
>
> Thank you for any help that you can give. I REALLY like the igraph
> libraries, and I do not want to search for another :)
>
> Best Regards,
> Kyle
>
> #include <igraph.h>
>
> int main(void) {
>   igraph_t graph;
>   igraph_vector_t v;
>   igraph_bliss_sh_t sh=IGRAPH_BLISS_FM;
>   igraph_bliss_info_t info;
>
>   int i,iMax=1000000;
>
>   igraph_real_t edges[] = { 0, 1, 1, 2, 2, 0 };
>   igraph_vector_view(&v, edges, sizeof(edges)/sizeof(double));
>
>   for(i=0;i<iMax;i++) {
>     igraph_create(&graph, &v, 0, IGRAPH_UNDIRECTED);
>     igraph_automorphisms(&graph,sh,&info);
>     igraph_destroy(&graph);
>   }
>
>   return 0;
> }
>
> --
> Kyle Bishop
> Ph.D. Candidate
> Chemical & Biological Engineering
> Northwestern University
>
> address@hidden
> 847/467-0116 (office)
> 847/354-1874 (cell)
> 847/332-2631 (home)
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

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