You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sage: for _ in range(1000):
....: s = SAT('glucose')
....: s.add_clause((1000,10))
....: _ = s()
....: del s
....:
Expected Behavior
sage: tmp_filename('AAAAAA')
'/tmp/tmp8tkni7g0/AAAAAAw9zty138'
sage: ls /tmp/tmp8tkni7g0/
AAAAAAw9zty138
sage: for _ in range(10):
....: s = SAT('glucose')
....: s.add_clause((1000,10))
....: _ = s()
....: del s
....:
sage: ls /tmp/tmp8tkni7g0/
AAAAAAw9zty138
Actual Behavior
Files remain in the tmp folder:
sage: tmp_filename('AAAAAA')
'/tmp/tmp8tkni7g0/AAAAAAw9zty138'
sage: ls /tmp/tmp8tkni7g0/
AAAAAAw9zty138
sage:
sage: for _ in range(10):
....: s = SAT('glucose')
....: s.add_clause((1000,10))
....: _ = s()
....: del s
....:
sage: ls /tmp/tmp8tkni7g0/
AAAAAAw9zty138 tmp__9688b61 tmp_j6m8wx1d tmp_yfyquecu
tmp_130r60ii tmp_97giqg02 tmp_rq5xdtoa tmp_z6knu_hr
tmp_1hbs_ysf tmp_hun_mc3u tmp_v5h_3r_b
These file add up to 20 GB of memory on a problem (involving lots of sat instances) I was recently looking at.
Additional Information
Here is one way to fix it (os.unlink):
sage: tmp_filename('AAAAAA')
'/tmp/tmp8tkni7g0/AAAAAAw9zty138'
sage: ls /tmp/tmp8tkni7g0/
AAAAAAw9zty138
sage:
sage: for _ in range(10):
....: s = SAT('glucose')
....: s.add_clause((1000,10))
....: _ = s()
....: os.unlink(s._headname)
....: del s
....:
sage: ls /tmp/tmp8tkni7g0/
AAAAAAw9zty138
In the method `DIMACS.__del__`, we delete the temporary file created in
the `DIMACS.__init__` method.
This fixessagemath#38328.
- [x] The title is concise and informative.
- [x] The description explains in detail what this PR is about.
- [x] I have linked a relevant issue or discussion.
- [x] I have created tests covering the changes.
- [x] I have updated the documentation and checked the documentation
preview.
URL: sagemath#38333
Reported by: Sébastien Labbé
Reviewer(s): Marc Mezzarobba
Steps To Reproduce
Expected Behavior
Actual Behavior
Files remain in the tmp folder:
These file add up to 20 GB of memory on a problem (involving lots of sat instances) I was recently looking at.
Additional Information
Here is one way to fix it (
os.unlink
):Environment
Checklist
The text was updated successfully, but these errors were encountered: