Ticket #49 (closed defect: fixed)
Reference cycle in HDUs causing memory leak
| Reported by: | stsci_embray | Owned by: | stsci_embray |
|---|---|---|---|
| Priority: | high | Milestone: | 3.0.0 |
| Version: | 2.4 | Severity: | major |
| Keywords: | Cc: | zonca@… |
Description (last modified by stsci_embray) (diff)
The following sample sent in by a user (Andrea Zonca; e-mail address in the CC list) illustrates the problem:
import objgraph import pyfits import gc import numpy as np print("Create table") #a=pyfits.Column(name='',format='K',array=[1,2,3]) # Column instead correctly frees up memory a=pyfits.new_table([pyfits.Column(name='',format='K',array=[1,2,3])]) print("Delete table") del a print("Garbage collect") gc.collect() gc.collect() gc.collect() print("Still there") print(objgraph.by_type('recarray')[0])
output:
output: Create table Delete table Garbage collect Still there [(1L,) (2L,) (3L,)]
Change History
Note: See
TracTickets for help on using
tickets.