Reference leak when using PointProcess.get_segment()
Posted: Sun Nov 09, 2014 7:12 pm
This is an issue I ran into while debugging unit tests in pynrn:
The output looks like:
It looks like the Section and IClamp are not collected, but where are the leaked references?
I've tried using `gc.collect()` and `sys.exc_clear()`. I also tried using `gc.get_referrers()` to see where the references might be but the lists come back empty, so I assume the leak is internal to NEURON?
Code: Select all
from neuron import h
s = h.Section()
c = h.IClamp(0.5, s)
g = c.get_segment()
del s
del c
del g
print "Sections:", len(list(h.allsec()))
print "IClamps: ", len(list(h.List('IClamp')))
Code: Select all
Sections: 1
IClamps: 1
I've tried using `gc.collect()` and `sys.exc_clear()`. I also tried using `gc.get_referrers()` to see where the references might be but the lists come back empty, so I assume the leak is internal to NEURON?