Maybe I am hanging onto them in my container class - Im not entirely sure though.
I put a few arraym into a container class with this PXD file snippet:
cdef class CVArrays(object):
cdef list array_list #A list of strings with the names of the arrays ['T','p',....]
#Storage arrays
cdef public arraym T,p,h,rho,V,dV,cp,cv,m,v,dpdT_constV,Q,xL,dudxL
#Property derivative arrays
cdef public arraym drhodtheta, dTdtheta, dmdtheta, dxLdtheta, summerdm, summerdT, summerdxL, property_derivs
and I try to kill the arraym instances when I am destructing the CVArrays instance by doing
cpdef free_all(self):
"""
Free all the arrays allocated
"""
for array_name in self.array_list:
if hasattr(self,array_name) and getattr(self,array_name) is not None:
(<arraym>getattr(self,array_name)).dealloc()
delattr(self,array_name)
and when I check gc.get_referents on the CVArrays instance it still sees all the arrays, though their memory has been deallocated. So perhaps the problem is elsewhere - I'm at my wits end now.
Do you have recommendations of means of debugging garbage collection?