Opened 9 years ago
Closed 8 years ago
#12622 closed defect (duplicate)
cliquer memory leaks
Reported by: | jason | Owned by: | jason, ncohen, rlm |
---|---|---|---|
Priority: | major | Milestone: | sage-duplicate/invalid/wontfix |
Component: | graph theory | Keywords: | |
Cc: | ncohen | Merged in: | |
Authors: | Jason Grout | Reviewers: | David Coudert, Nathann Cohen |
Report Upstream: | N/A | Work issues: | |
Branch: | Commit: | ||
Dependencies: | Stopgaps: |
Description
See http://ask.sagemath.org/question/1191/memory-blowup-2 for the initial report. Basically, Sage's interface to cliquer has a number of memory leaks:
- in cliquer.pyx, graph_new is called several times without a corresponding graph_free.
- The lists that are returned from the cliquer functions are not deallocated.
- Inside the cliquer spkg, the cl.c file allocates lots of option structs through calls to
sage_init_clique_opt()
, but never deallocates them.
Attachments (1)
Change History (7)
comment:1 Changed 9 years ago by
- Status changed from new to needs_review
comment:2 Changed 9 years ago by
- Status changed from needs_review to needs_work
Changed 9 years ago by
comment:3 Changed 9 years ago by
I'm not so sure about using sage_free to free memory allocated by cliquer's malloc. Could that cause problems?
Anyways, the attached patch and the above changes make a *huge* difference in memory usage when calculating cliques over a large range of graphs.
comment:4 Changed 9 years ago by
- Reviewers set to David Coudert
Apparently this patch is ready to be reviewed, but has still a needs_work status. I tried it and it is working correctly (install, tests, docbuild,...).
However, I don't know how to evaluate the memory improvements. Could you provide an example ?
comment:5 Changed 8 years ago by
- Milestone changed from sage-5.9 to sage-duplicate/invalid/wontfix
- Reviewers changed from David Coudert to David Coudert, Nathann Cohen
- Status changed from needs_work to positive_review
Duplicate of #12905
Nathann
comment:6 Changed 8 years ago by
- Resolution set to duplicate
- Status changed from positive_review to closed
Here are my changes to the cl.c file inside the cliquer spkg. Do you happen to have time to package these up, Nathann? I was a little confused since usually unmodified source is supposed to be in the src/ directory, but it looks like we have sage-specific stuff in the src/ directory in the cl.c file.